这个服务是猪齿鱼微服务框架的权限认证中心,它主要保证用户权限与用户认证。
access_token
,并将其存放在tokenStore
中。access_token
。在oauth完成检验后,请求会由网关转发到相应的资源服务application.yml
spring:
datasource:
url: jdbc:mysql://localhost/base_service?useUnicode=true&characterEncoding=utf-8&useSSL=false&useInformationSchema=true&remarks=true
username: choerodon
password: 123456
redis:
host: localhost
port: 6379
database: 1
eureka:
instance:
preferIpAddress: true
leaseRenewalIntervalInSeconds: 10
leaseExpirationDurationInSeconds: 30
metadata-map:
CONTEXT-PATH: oauth
client:
serviceUrl:
defaultZone: ${EUREKA_DEFAULT_ZONE:http://localhost:8000/eureka/}
registryFetchIntervalSeconds: 10
mybatis:
mapperLocations: classpath*:/mapper/*.xml
configuration:
mapUnderscoreToCamelCase: true
feign:
hystrix:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000
ribbon:
ReadTimeout: 10000
ConnectTimeout: 10000
choerodon:
redisHttpSession:
enabled: true
oauth:
clear-token: true
enabled-single-login: false
access-token-validity-seconds: 86400
login:
field: mail,phone
path: /login
ssl: false
loginPage.title: Choerodon
reset-password:
check: true
default:
redirect:
url: http://localhost:8080/manager/swagger-ui.html
hook:
token: abc
db:
type: mysql
bootstrap.yml
server:
port: 8020
servlet:
contextPath: /oauth
spring:
application:
name: oauth-server
cloud:
config:
uri: http://localhost:8010/
enabled: false
fail-fast: true
retry:
max-attempts: 6
max-interval: 2000
multiplier: 1.1
management:
endpoint:
health:
show-details: ALWAYS
server:
port: 8021
endpoints:
web:
exposure:
include: '*'
oauth-server
服务依赖于 base-service 服务的数据库, 所以请确保 base-service
服务的数据库已经创建并初始化。EurekaServer
,本地环境需要 eureka-server
,线上环境需要使用 go-register-server
运行 eureka-server
,代码库地址。
本地启动 redis-server
启动项目,项目根目录下执行如下命令:
mvn spring-boot:run