【问题标题】:Spring boot OAuth 2 gives "Unauthorized Error"Spring boot OAuth 2 给出“未经授权的错误”
【发布时间】:2018-04-15 10:37:26
【问题描述】:

项目地点:https://github.com/nydiarra/springboot-jwt

我正在使用上述项目通过 Spring Boot 完成 OAuth 身份验证。但是在调用“http://localhost:8080/oauth/token”时,在我将“spring-boot-starter-parent”版本升级为“2.0.0.RELEASE”后会抛出“Unauthorized”错误。我该如何解决这个问题?

克隆项目时,“spring-boot-starter-parent”版本为“1.5.3.RELEASE”,这意味着我可以进行身份​​验证。 更改版本后,抛出“未经授权”错误。

【问题讨论】:

标签: java spring spring-boot oauth-2.0


【解决方案1】:

看起来您正在使用 shapassword 编码器,编码强度为 256。对您的密码进行编码并将其添加到 application.properties 的 security.jwt.client-secret 中

并在您的 pom 中替换以下依赖项

<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.10.RELEASE</version>
</dependency>

这应该可以正常工作

【讨论】:

    猜你喜欢
    • 2018-07-04
    • 1970-01-01
    • 2014-03-08
    • 2022-01-21
    • 2020-10-22
    • 2015-10-13
    • 1970-01-01
    • 2013-08-03
    • 1970-01-01
    相关资源
    最近更新 更多