Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 外部化的Spring OAuth2配置_Spring Boot_Spring Security_Docker Compose_Spring Oauth2 - Fatal编程技术网

Spring boot 外部化的Spring OAuth2配置

Spring boot 外部化的Spring OAuth2配置,spring-boot,spring-security,docker-compose,spring-oauth2,Spring Boot,Spring Security,Docker Compose,Spring Oauth2,我有一个资源服务器Spring boot应用程序(即@enableSourceServer注释类),它有以下application.yml,运行非常好: ... security: oauth2: resource: userInfoUri: http://localhost:9100/oauth/user ... 但是,当我尝试使用环境变量作为docker映像(来自docker文件)运行服务器时,它不会考虑我的配置。服务器仍将使用application.yml中的配置

我有一个资源服务器Spring boot应用程序(即@enableSourceServer注释类),它有以下application.yml,运行非常好:

...
security:
  oauth2:
    resource:
      userInfoUri: http://localhost:9100/oauth/user
...
但是,当我尝试使用环境变量作为docker映像(来自docker文件)运行服务器时,它不会考虑我的配置。服务器仍将使用application.yml中的配置

 (from my **docker-compose.yml** file)
...
 environment:
      - SERVER_PORT=8999
      - SECURITY_OAUTH2_RESOURCE_USER-INFO-URI=http://oauth-server:7777/oauth/user
...

尝试使用外部IP而不是服务名称oauth-server。不,这不是问题,因为我的服务器正在向application.yml中设置的url发送请求。但是我想要的是使用指定为OS环境变量的url哦,试试
SECURITY\u OAUTH2\u RESOURCE\u USERINFOURI