Spring Boot管理服务器。无法访问由OAuth2保护的服务

时间:2019-08-19 10:26:29

标签: java spring spring-boot spring-oauth2 spring-boot-admin

我需要将spring boot admin服务器配置为仪表板。直到尝试访问允许的区域(例如retry-server),它才能正常工作。

我已经为此服务器使用了可自动配置的OAuth2客户端:

security:
  enable-csrf: false
  oauth2:
    client:
      clientId: edge-client
      clientSecret: test
      accessTokenUri: http://localhost:8082/oauth/token
      userAuthorizationUri: http://localhost:8082/oauth/authorize
    resource:
      userInfoUri: http://localhost:8082/user/me
      tokenInfoUri: http://localhost:8082/oauth/check_token

问题:

我应该如何改善配置以使retry-server服务器可以访问spring boot admin?我遇到的错误消息是:

<oauth>
  <error_description>
    Full authentication is required to access this resource
  </error_description>
  <error>unauthorized</error>
</oauth>

P.S。

...为了OAuth2安全性,我已激活client_credentials授予类型。我可以使用OAuthcurl服务器接收所需的访问令牌,它也可以通过retry-server访问curl。但这并没有帮助我将这种方法集成到spring boot admin中。

P.S.2。

我已经开始向eureka discovery服务器注册的所有服务器,但我不知道它如何解决当前问题。

0 个答案:

没有答案