Spring Cloud 注解说明

context-path: /uaa:#认证服务上下文地址(必须配置)

uaa配置

spring:
  application:
      name: secu-oauth
  cloud:
    config:
      discovery:
        service-id: config-server
        enabled: true
      profile: dev
      name: ${spring.application.name}, db-config
  redis:
    host: localhost
    port: 6379
  mvc: 
    view: 
      prefix: classpath:/templates/
      suffix: .html 
server:
  port: 8763
  servlet: 
   context-path: /uaa   #认证服务上下文地址(必须配置)
  
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
      

#logging:
#  config: classpath:log4j2.xml
#feign:
#  hystrix:
#    enabled: false
  

zuul配置

spring:
  application:
      name: zuul-server
  cloud:
    config:
      discovery:
        service-id: config-server
        enabled: true
      profile: dev
      name: ${spring.application.name},oauth2-api,db-config

server:
  port: 8767
  
zuul:
  routes:
    uaa:
      path: /uaa/**
      sensitiveHeaders: "*"
      serviceId: secu-oauth
#    order:
#      path: /accounts/**
#      sensitiveHeaders: "*"
#      serviceId: account-service
  add-proxy-headers: true

security:
  basic:
    enabled: false 
  oauth2: 
#   sso: 
#    loginPath: /login
   client: 
    accessTokenUri: http://localhost:8767/uaa/oauth/token
    userAuthorizationUri: http://localhost:8767/uaa/oauth/authorize
    clientId: android
    clientSecret: android
   resource:
      id: zuul-server
      user-info-uri: http://localhost:8767/uaa/user
      prefer-token-info: false

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
Spring Cloud 注解说明_第1张图片

你可能感兴趣的:(SpringCloud,Spring,Cloud,Oauth2,spring,scurity)