To give a more detailed explanation:
- When ConsentRequest is accepted a “policy” claim is added to the AccessToken & IDToken
Session: &models.ConsentRequestSession{
AccessToken: map[string]interface{}{"policy": "readonly"},
IDToken: map[string]interface{}{"policy": "readonly"},
},
- I can verify this is added to the session as a request to the REST API /oauth2/auth/sessions/consent
show the added policy claim:
"session":{"access_token":{"policy":"readonly"},"id_token":{"policy":"readonly"}}
-
The access code is then used to Exchange and obtain an jwt encoded openid token
which does contain the "policy":"readonly"
jwt claim as expected
-
We restart the flow again in exactly the same way and ask for a new access code and exchange it to get an id_token
but now the "policy":"readonly"
jwt claim is gone in the openid token
I would have expected these additional/custom claims to always be present even if this second code/token flow reuses the accepted consent request ( we set Remember = true in the consent app ).
Additionally these additional/custom claims saved in the session during accept consent aren’t present in the userinfo response nor in the introspect response
Are we trying to add these additional/custom claims the wrong way or is this a bug? Or is the remember consent functionality causing this?