美文网首页
基于服务发现(Service discovery)使用OAUTH

基于服务发现(Service discovery)使用OAUTH

作者: 狼團 | 来源:发表于2018-11-22 09:13 被阅读0次

配置文件定义

security:
  oauth2:
    resource:
      user-info-uri: http://auth-server/me   # auth-server 为OAuth2 Server在注册中心的service id
      prefer-token-info: true # Use the token info, can be set to false to use the user info.

配置 OAuth2 Rest template

    @Bean
    @LoadBalanced
    public OAuth2RestTemplate restTemplate(UserInfoRestTemplateFactory factory) {
        return factory.getUserInfoRestTemplate();
    }

相关文章

网友评论

      本文标题:基于服务发现(Service discovery)使用OAUTH

      本文链接:https://www.haomeiwen.com/subject/iwukqqtx.html