【问题标题】:Oauth2 authorization using google as provider使用谷歌作为提供者的 Oauth2 授权
【发布时间】:2022-01-25 15:06:55
【问题描述】:

我的前端是 Angular,后端是使用 spring security 的 spring micoservice。 我需要通过 facebook 使用 oauth2 授权。 从 Angular 我使用“http://localhost:8080/oauth2/authorization/facebook”来获取授权端点并成功获取代码和状态。 现在我需要从 facebook 获取令牌。我尝试使用“http://localhost:8080/login/oauth2/code/facebook”作为令牌端点并提供代码和状态作为参数。但它的抛出错误。

“http://localhost:8080/login/oauth2/code/facebook?code=XXXXX&state=YYYYY”在我的 spring 安全后端没有给出正确的响应。

application properties :
spring.security.oauth2.client.registration.facebook.clientId =  
spring.security.oauth2.client.registration.facebook.clientSecret = 
spring.security.oauth2.client.registration.facebook.redirectUri:

我的 spring 后端在 8080 上。

我的令牌端点是否正确?我在这里做的任何错误,谢谢。

【问题讨论】:

    标签: angular oauth-2.0 spring-security-oauth2


    【解决方案1】:

    我在 google 开发控制台中添加了一个新的重定向 uri,它得到了解决。

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 2011-12-10
    • 2013-09-05
    • 1970-01-01
    • 2018-03-10
    相关资源
    最近更新 更多