Search code examples
keycloakquarkusoidquarkus-oidc

Getting the field issuedFor from SecurityIdentity using OIDC and KeyCloak


I am using OIDC and KeyCloak Quarkus extensions.

Currently, I access the token information like this:

@Inject org.eclipse.microprofile.jwt.JsonWebToken tokenMicroProfile;
@Inject SecurityIdentity securityIdentity;

I could not find the issuedFor field in these abstractions. This seems to have what I need.

@Inject org.keycloak.representations.JsonWebToken tokenKeyCloak;

But injection fails. So, how can I get the information using quarkus-oidc?


Solution

  • You can do tokenMicroProfile.getClaim("azp") or tokenMicroProfile.getClaim(Claims.azp).