quick-beard-12204
01/18/2024, 9:28 AMprotected.main.localhost/
2. proxy calls oathkeeper.internal/
3. oathkeeper with cookie authenticator calls kratos.internal/
4. kratos.internal/
redirects to account.main.localhost/login?redirect_to=...
5. account.main.localhost/
starts a browser based flow with kratos.main.localhost/
6. User enters credentials, OK, redirect back to protected.main.localhost/
7. this time oathkeeper.internal/
finds a session cookie on the request, so it lets the request to continue
Now, i want to use kratos user DB in a third-party app on a different domain, app.acme.localhost
.
But since third-party cookies won't be sent, oathkeeper won't receive cookies set by kratos on the domain .main.localhost
- so apparently the cookie authenticator is a no go.
What is the correct way to configure oathkeeper/kratos for this use-case?icy-manchester-83109
01/18/2024, 10:44 AMquick-beard-12204
01/18/2024, 11:31 AMapp.acme.localhost
2. proxy forwards request to oathkeeper.internal/
3. no session found (should be in oauth/oidc token format?), redirects to OIDC login?
4. ???
5. app.acme.localhost
initiates an auth flow with hydra.main.localhost
(could be using a BFF pattern)
Won't go further with steps now, since i have some doubts on step 3/4icy-manchester-83109
01/18/2024, 12:14 PMapp.acme.localhost
2. app.acme.localhost
executes the authorization code grant flow (using hydra) and receives an access token
3. app.acme.localhost
accesses whatever resources at protected.main.localhost
and adds the received access token to the request.
4. proxy in front of protected.main.localhost
calls oathkeeper.internal
5. oathkeeper with jwt or introspection authenticator verifies either the jwt or calls the introspection endpoint from hydra to get information about the user represented by the token
6. if 5 was ok, oathkeeer allows the request to be forwarded to protected.main.localhost
resourceicy-manchester-83109
01/18/2024, 12:15 PMapp.acme.localhost
(that app plays the client, respectively the relying party role (latter is the definition for the same from OIDC)).icy-manchester-83109
01/18/2024, 12:16 PMicy-manchester-83109
01/18/2024, 12:21 PMapp.acme.localhost
, to move the execution of the flow out of the own code. In that case each and every request to app.acme.localhost
will be intercepted by such proxy and depending on the settings for the corresponding endpoint drive the flow if required. The app will then get the access token and or id token for further usage (that again dependes on the configuration of such a proxy). Note: Oathkeeper does not support that.quick-beard-12204
01/18/2024, 12:27 PMhydra.main.localhost
?icy-manchester-83109
01/18/2024, 12:28 PMicy-manchester-83109
01/18/2024, 12:29 PMquick-beard-12204
01/18/2024, 12:31 PMjwt
and various oauth
type authenticators. Aren't those meant to be used in this scenario?icy-manchester-83109
01/18/2024, 12:36 PMicy-manchester-83109
01/18/2024, 12:36 PMquick-beard-12204
01/18/2024, 12:37 PMoathkeeper
denies a request with 401, it`s the proxy that should redirect to a URL to get a oauth token*, and after getting one, retry the request setting it in header/query param so oauthkeeper
can introspect/verify with kratos
*could be the ory/hydra-login-consent-node
icy-manchester-83109
01/18/2024, 12:39 PM... it`s the proxy that should redirect to a URL to get a oauth token ...Yes
could be theNo. That is the "frontend" for hydra (glue code with your idp, here kratos)ory/hydra-login-consent-node
quick-beard-12204
01/18/2024, 12:42 PMproxy
-> ?
-> hydra-node
-> hydra
-> kratos
quick-beard-12204
01/18/2024, 12:43 PMicy-manchester-83109
01/18/2024, 2:05 PM