Hello, here is the use case : in our client app we need to react to the amr
claim provided by Keycloak. We have no problem to get this claim when the user authenticates throught the standard browser flow. But when the user chooses to authenticate through a brokered OIDC identity provider, the amr
claim provided by the idp is in the token provided by the idp to keycloak but it is not in the token provided by keycloak to the client app.
For the authentication via standard flow, we’re using the built-in “Authentication Method Reference (AMR)” protocol mapper (no problem here). But what would be the best way to handle the propagation of amr
coming from the idp ?
We already have a custom SPI for the idp, so we are able to modify its code if necessary, but I’m not sure it is not the right place to implement what we need.
My first idea was to use a ClaimToUserSessionNote idp mapper to store the idp amr
claim in the session notes, and then add a UserSessionNoteMapper to the client scope where we already have the built-in AMR protocol mapper.
Some members of the team think we should handle this in the SPI code (even if they can’t explain why …) but I feel my idea is a better practice (as I use built-in mecanism instead of coding custom ones).
Any opinions ? or other ways to propagate amr list coming from idp ?