0

我正在按照以下内容在 PCF 中设置配置服务器并访问 PCF 中的应用程序。

https://github.com/pcf-guides/gs-configuration-server

我已经从 PCF 市场添加了配置服务器,它与应用程序绑定。

配置服务器指向以下 Git 存储库:

https://github.com/pcf-guides/configuration-server-config-repo.git

VCAP_SERVICES 如下所示:

 "p-config-server": [
  {
  "binding_name": null,
  "credentials": {
   "access_token_uri": "https://p-spring-cloud- 
  services.uaa.run.pivotal.io/oauth/token",
   "client_id": "p-config-server-d837bb39-4cf1-47ce-994b-03257852a7f6",
   "client_secret": "XXsWzX6IhKME",
   "uri": "https://config-9f0e115f-dbb0-42e8-981a-e70e2cd62570.cfapps.io"
  },
  "instance_name": "sconfigserver",
  "label": "p-config-server",
  "name": "sconfigserver",
  "plan": "trial",
  "provider": null,
   "syslog_drain_url": null,
 "tags": [
 "configuration",
 "spring-cloud"

每当我尝试访问应用程序身份验证错误时:访问此资源需要完全身份验证。

我在应用程序中没有任何安全配置。

4

2 回答 2

0

在您的 application.properties 文件中,您应该添加以下内容

management.security.enabled=false

这将完全禁用安全性。

于 2019-07-07T20:06:46.307 回答
0

我在我的主要应用程序类中尝试了这个并且对我来说工作得很好

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class , ManagementWebSecurityAutoConfiguration.class})
于 2019-07-10T04:27:10.660 回答