Start Keycloak. For more information on installing and starting Keycloak, see the
Keycloak Getting started documentation.
In the Keycloak Admin Console, create a new Realm
MyDemoRealm in the Realm settings.
In the Realm MyDemoRealm, create a new client, for
example:
Client ID: Demo
Home URL:
http://localhost:8080/realms/MyDemoRealm/Demo/
Client authentication is turned on.
In the Client details page of the new client, you can
get the Client Secret in the
Credentials tab.
The URL
http://localhost:8080/realms/MyDemoRealm/protocol/openid-connect/certs
is accessible. It will return the information of the keys.
Send a POST request using Postman to the URL
http://localhost:8080/realms/MyDemoRealm/protocol/openid-connect/token
with the client_id, client_secret values
obtained from the Client details page and
grant_type set to
client_authentication.
The response from this POST request will be the access token and its
properties. This access token will be used to send a request to the JWT validation
enabled REST services.