私はSpring Security Plugin(from here)をインストールしました。私は非常に密接にブログ投稿に従ったhere。私は、ブログの記事の中で述べてと全く同じでしたが、私は、プラグインを介してログインしようとしたとき、私はこのようなエラーを取得していにもかかわらず:私はSpring Security Plugin経由でログインできません
:ここSorry, we were not able to find a user with that username and password.
は私BootStrap.groovy
ファイルです
def springSecurityService
def init = {
def userRole = SecRole.findByAuthority('ROLE_USER') ?: new SecRole(authority: 'ROLE_USER').save(failOnError: true)
def adminRole = SecRole.findByAuthority('ROLE_USER') ?: new SecRole(authority: 'ROLE_USER').save(failOnError: true)
def adminUser = SecUser.findByUsername('antoaravinth') ?: new SecUser(
username: 'antoaravinth',
password: springSecurityService.encodePassword('secret'),
enabled: true).save()
if (!adminUser.authorities.contains(adminRole)) {
SecUserSecRole.create adminUser, adminRole
}
println "adminUser is $adminUser"
println "adminRole is $adminRole"
}
私が試したときにgrails run-app
adminUser
とadminRole
の両方の値が私のコンソールに表示されています。しかし、それでも私はログインすることができませんでした。なぜですか?
ありがとうございます。
あなたは慎重にブログ記事を読んでいないと私はあなたが自分を探してではなく、SO上のあらゆる問題の解決を求める必要がありますね。 –
@downvoters:なぜdownvote? –
ああ大変申し訳ありません!私は読んでいる間にその部分をスキップしました:(このような愚かな質問のために申し訳ありません!! –