Replies: 2 comments
-
|
Have you solved this? I am wondering similar: https://github.com/orgs/ory/discussions/147 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hello @melezhik You’re right that with the stack you describe nothing “automatically” puts all Kratos traits into the JWT. The default consent UI only maps email (and some profile fields if the scope is profile) from the Kratos identity into ID token claims. You have 2 ways to add custom claims into a JWT:
With regards to Oathkeeper + Keto: once you enrich the token via one of the above:
Let me know if that helps |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Imaging following ory setup :
Hydra that uses Kratos as IDP provider, upon successful login, session in Kratos is created and jwt token retuned to a client app ( frontend )
Oathkeeper is used as an authorization proxy through which all requests to protected resources go.
Oathkeeper has only jwt authenticator enabled and one remote json authorizer enabled which send payload ( http method, uri and user traits extracted from authentication session object ) to keto backed endpoint which performs authorization. Authorization rules are written in terms of user traits.
The question how traits from user ( identity schema ) are propagated to jwt token ? Apparently traits have to be presented in payload send to keto authorization endpoint as Keto permission rules are implemented in terms of those user traits .
My current impression ( I maybe wrong ) backend that receive access token from hydra ( after authorization code exchange ) need somehow inject users traits taken from user Kratos session object into jwt token before it returns it to client app ( front end ).
Beta Was this translation helpful? Give feedback.
All reactions