Getting user's access-token using clientId/secret

Hello,

We got java spring app where we use keycloak-admin-client lib.
Usualy we use user pass and user name to get his access-token and refresh-token but now we got new requirements:
How to get user access-token but using keycloak client data (I got access to clientId and client secret) ?

It sounds like you might want a Keycloak Service Account. This gives you an Access Token when specifying only client_id and client_secret. Be advised though that this isn’t a real user so the preferred_username and realm_roles fields may look different.

1 Like

Just to add the link to the standard: if you want a token in the context of the client (app), it is related to client credentials grant [1].

[1] RFC 6749 - The OAuth 2.0 Authorization Framework

1 Like