Getting the field issuedFor from SecurityIdentity using OIDC and KeyCloak

257 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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