This is a simple OAuth2 workflow (Spring boot application). Here I have separated the Authorization server and resource server.
Added JDBC to store the Oauth2 tokens.
- Using JDBC token store
- Separated Authorization server and Resource server.
Run both Auth server and resource server.
http://localhost:8081/oauth/token/grant_type=client_credentials&client_id=client&client_secret=secret
Response
{ "access_token" : "...",
"token_type" : "...",
"expires_in" : "...",
"scope" : "..."
}
http://localhost:8080/
Authorization: Bearer 5cf0732b-6bbb-40c7-8fab-dcfefcc2fcfe