我正在尝试使用 grails 实现 Google/LinkedIn 注册/登录。我从 spring security rest 插件开始,这是我的 application.groovy 文件:
oauth {
frontendCallbackUrl = { String tokenValue -> "http://localhost:8080/auth/success?token=${tokenValue}" }
google {
client = org.pac4j.oauth.client.Google2Client
key = "93928074758-p687srmuti88m9ud6k16ngaeenglac5n.apps.googleusercontent.com"
secret = "p3IF_jei8YIv2FF7nYjqPBTM"
scope = org.pac4j.oauth.client.Google2Client.Google2Scope.EMAIL_AND_PROFILE
defaultRoles = []
}
linkedin {
client = org.pac4j.oauth.client.LinkedIn2Client
key = "77krf1ww7mhbx7"
secret = "KYCZT14ZVyts8sAM"
scope = "r_emailaddress"
defaultRoles = []
}
}
我能够获取通过 Google 收集的用户数据,但在 LinkedIn 中,获取信息的 URL 存在问题。
这是我从 LinkedIn 收到的 XML 回复:
<error>
<status>410</status>
<timestamp>1573061835025</timestamp>
<request-id>7XT0T4X984</request-id>
<error-code>0</error-code>
<message>This resource is no longer available under v1 APIs</message>
</error>
你有什么技巧来实现这个吗?您能在 LinkedIn 配置中看到任何缺失的参数吗?
提前致谢。
PD:这是我正在使用的插件文档:https ://alvarosanchez.github.io/grails-spring-security-rest/latest/docs/