- Reference - - (https://medium.com/@bcarunmail/securing-rest-api-using-keycloak-and-spring-oauth2-6ddf3a1efcc2)
- Create Admin User - http://localhost:8080/auth
- Login to the admin console - http://localhost:8080/auth/admin
- Create a realm
- Add Client
Client ID : <your_client_name>
Client Protocol : openid-connect
- Configure Client
Access Type : confidential
Valid Redirect URIs : http://localhost:8085
- Create Client Role
- Create a Mapper
Property : username
Token Claim Name : user_name
Add to Access Token : true
- Create a user and Set Password
- Map Client Role To User
- Get Configuration From OpenID Configuration Endpoint
GET http://localhost:8080/auth/realms/dev/.well-known/openid-configuration
gradle build
gradle run
Use Postman Suite