【发布时间】:2016-12-24 04:24:22
【问题描述】:
我正在尝试连接到托管在关键云代工厂中的 spring 云配置配置服务器(服务)。
配置服务受 OAuth2 保护,我无法让客户端通过配置服务器进行身份验证。我不断收到 401 Unauthorized 消息。
我无法在 bootstrap.yml 中找出正确的属性组合。
这是我当前的 bootstrap.yml,您可以看到我尝试过很多不同的配置,我什至已经从等式中删除了 Pivotal Cloud Foundry,并试图从我的本地主机中访问它,同时我正在处理这些安全错误。
bootstrap.yml:
#Search for System Property of cloud config server, otherwise use localhost
config server.
spring:
cloud:
config:
enabled: true
#uri: ${vcap.services.config-server.credentials.uri:http://localhost:8888}
uri: https://config-fa3bfbbf-546c-a2c0-b07a-136da18a4fa1.host.domain.com
authorization: ${security.oauth2.client}
#username: ${vcap.services.config-server.credentials.client_id}
#password: ${vcap.services.config-server.credentials.client_secret}
name: app
#token: ${security.oauth2.client.token-name}
security:
basic:
enabled: false
oauth2:
client:
#id: ${vcap.services.config-server.credentials.client_id}
#client-secret: ${vcap.services.config-server.credentials.client_secret}
#access-token-uri: ${vcap.services.config-server.credentials.access_token_uri}
id: p-config-server-9281df10-bc67-49a2-863b-48844a1ce724
client-secret: UIcc1m6lvvHK
access-token-uri: https://p-spring-cloud-services.uaa.domain.host.com/oauth/token
token-name: config-server-token
感谢任何见解、提示或指示。
如果我能够在解决此 401 错误方面取得任何进展,我将继续发布此问题的后续信息。
关于它的价值的非描述性错误消息:
GET request for "https://config-fa3bfbbf-546c-a2c0-b07a-136da18a4fa1.host.domain.com/app/dev" resulted in 401 (Unauthorized); invoking error handler
Could not locate PropertySource: 401 Unauthorized
【问题讨论】:
标签: spring-boot spring-security spring-security-oauth2 cloud-foundry spring-cloud-config