Hello all! Can we do oauth2 authentication flow ju...
# talk-oathkeeper
g
Hello all! Can we do oauth2 authentication flow just using oathkeeper and hydra? Can oathkeeper process the flow by itself? I am just wondering if it is possible to support it nativally with ory stack and without using libs like nextauth.js or passport.js?
n
that's currently how we're using them, hydra generates the oauth token then oathkeeper verifies it using https://www.ory.sh/docs/oathkeeper/pipeline/authn#oauth2_introspection
you do have to have some external authentication system, as hydra does not provide that, it just attaches oauth to an existing authentication flow, but you can use kratos for that if you don't already have an auth flow
g
Thank you! So we still need to use libs to process the auth on the client side. to get tokens, etc.
n
yes, you need something to fulfill the auth flow during the oauth consent cycle of hydra, but once oauth has completes you don't technically need anything to verify those oauth tokens on the service side as oathkeeper can handle that, as long as you can ensure traffic to your app only comes from oathkeeper, then oathkeeper can be your trustless edge into your trusted internal network
in our case, we already had a home-grown auth flow, so we used hydra to add oauth/openid connect, and now our plan for later this year is to replace that home-grown system with kratos, so we can completely get out of the auth game in our code
g
Nice!