Setting custom claims on a remembered session #3020
-
When a user enters the OIDC auth flow, and they are remembered, it doesn't appear that the custom claims set during their initial authentication are automatically applied to the tokens that are returned to the client. For example, if I set a custom claim on the ID token for temperature (thought experiment only), and the temperature was 20 C, the ID token when they authenticate will contain a If later that evening the client submits an authentication request on their behalf, and the user is already authenticated, the claim isn't magically added somehow to the token. It appears that I need to set the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I'd like to extend this question because it seems to be related to my case. Here is the scenario:
Question: how do I get them from previous authentication? Here I see two options:
Any thoughts on how to propagate Session data from previously issued tokens to newly created when skip=true? |
Beta Was this translation helpful? Give feedback.
-
Hello @tbalasavage Using the list consent sessions endpoint seems a good way to solve get the previous claims. Is the problem that in step 3. the consent screen is skipped (skip=true) and the extra fields for id tokens are not set? See also the threads on custom claims linked above. |
Beta Was this translation helpful? Give feedback.
-
@tbalasavage correct - it is expected that, on consecutive consent flows, the session data is provided by the consent app. We only carry over data on refresh requests as we are 100% certain that the information should be carried on in this step. For consent, this is very different for every application and can thus not be set automatically. |
Beta Was this translation helpful? Give feedback.
-
Regarding the other questions in this thread, we want to introduce a field such as |
Beta Was this translation helpful? Give feedback.
@tbalasavage correct - it is expected that, on consecutive consent flows, the session data is provided by the consent app. We only carry over data on refresh requests as we are 100% certain that the information should be carried on in this step. For consent, this is very different for every application and can thus not be set automatically.