This message was deleted.
# general
m
This message was deleted.
f
How do I configure hydra to reject the auth flow if the current user is not allowed to access the client app that initiated the flow?
You can use oathkeeper and configure cookie_session authenticator. In that case, oathkeeper passes only authenticated requests to hydra. The example configuration of oathkeeper.yml and access-rules
The app can access user info stored in kratos through the
sessions/whoami
endpoint, but this is possible only if the app runs on the same domain as kratos because of the cookie domain configuration. Apps on a different domain can’t access the kratos session.
You can use oathkeeper’s mutators (id_token for example) and pass the information to Hydra. On accept login you can add json information about the user (without personal data. E.g. user_id) and use adminGetIdentity API method
I think that using oathkeeper can save you time to pass only authenticated requests to your backends. You can handle the rest by implementing middlewares (e.g. get identity_id from the session and get the data about this identity)
f
Thanks for the reply ... I'll have a look on oathkeeper and see how to go about this.