我正在寻找grails插件的建议:
我正在开发Grails 3.1.9应用程序,我需要添加功能google登录按钮。
grails:
plugin:
springsecurity:
oauth2:
providers:
google:
api_key: myKey
api_secret: mySecret
successUri: /oauth2/google/success
failureUri: /oauth2/google/failure
callback: /oauth2/google/callback
active: true
registration:
askToLinkOrCreateAccountUri: /oauth2/ask
roleNames: ['ROLE_USER'] grails init-oauth2 myPackage User OAuthID<oauth2:connect provider="google" id="google-connect-link">Google</oauth2:connect>
Logged with google?
<oauth2:ifLoggedInWith provider="google">yes</oauth2:ifLoggedInWith>
<oauth2:ifNotLoggedInWith provider="google">no</oauth2:ifNotLoggedInWith>问题是,在我单击at通过google登录后,我的页面就会刷新并转到/ login /auth。在Oauth2中,没有重定向到google的身份验证,代码永远不会回叫函数。
有人知道我做错了什么或错过了什么吗?我真的很感谢你的任何建议或示范。
发布于 2018-04-03 00:56:17
您是否添加了OAuthID作为插件所需的参数如下所示?
grails.plugin.springsecurity.oauth2.domainClass = 'myPackage.OAuthID‘
https://stackoverflow.com/questions/49611343
复制相似问题