Mapping custom value from an Authenticator to access token #12869
Unanswered
jfrantzius
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, in our project we successfully implemented a custom
Authenticatorin Keycloak for a “magic link” login method, and now we want to reflect this authentication method in the JWT access token, so the application can decide to force an additional password login for functionalities with higher security requirements. Is there maybe already some existing functionality to reflect different authentication methods in the access token?I was thinking of a Custom Protocol Mapper that writes this e.g. as a property
loginMethod:"magic-link"into the access token, but I wonder how that information can be passed from ourAuthenticatorto ourOIDCAccessTokenMapper.In the
Authenticator, I was thinking of usingAuthenticationFlowContext.getAuthenticationSession().setUserSessionNote(name, value);to store it, and then usinguserSession.getNote(name)in theOIDCAccessTokenMapperto obtain it. Now I wonder about two things:userSession.getNote()contain the value, so it will be mapped to the new access token?Beta Was this translation helpful? Give feedback.
All reactions