The project display how to setup an authorization server, and how to use it.
it includes three modules:
- uim: it's a customize authorization server, core module.
- uim-client: it's a client that can use git auth and customize auth to do authorization.
- uim-resource-server: it's a resource server that use JWT token which created by customize authorization server.
SampleAuthenticationProviderused to do authorization, verify username/password.SampleRegisteredClientRepositoryused to create a registered client, verify client-id/client-secret.SampleUserDetailServiceused to manage user detail.
- Use git authorization. You need config git client-id and client-secret.
github:
client-id: 7303adf998aeaed89cf2
client-secret: 4c53dbce42180499c2593a28ef93726fddfbc583
- Use Customize authorization. Be sure that you add openid in scope as default, otherwise the authorization process will be broke due to incorrect user information.
spring:
...
security:
oauth2:
client:
registration:
localhost:
client-id: kevin
client-secret: kevin
scope:
- "openid"
- "user:read"
- "user:write"
client-authentication-method: client_secret_basic
authorization-grant-type: authorization_code
redirect-uri: http://127.0.0.1:8002/login/oauth2/code/localhost
provider: custom-issuer
client-name: Localhost
provider:
custom-issuer:
issuer-uri: http://uim.kevin.com
Be sure that you use jwk-set-uri as authorization server.
spring:
...
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri: http://uim.kevin.com/oauth2/jwks