-
-
Notifications
You must be signed in to change notification settings - Fork 965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hydra + Kratos login flow #3108
Comments
+1 |
Hello @friedemannsommer & @fabhuebner See this PR: ory/examples#67 This is a community effort to create a self-hosted Ory Kratos + Hydra integration example. |
@vinckr If I understand the example correctly, it's using the Kratos init flow redirect and then loads the given flow which prevents part of the issue I described. if (!isQuerySet(flow)) {
logger.debug("No flow ID found in URL query initializing login flow", {
query: req.query,
})
res.redirect(303, initFlowUrl)
return
} Example source references:
Sadly I'm unable to implement it like this and must rely on the JSON response of these endpoints. Which leads me to think, it is expected that the Based on the current implementation of the example I don't understand how the redirect after a successful login should work. Does Kratos redirect to Hydra if the form data is passed directly to |
thanks for the detailed response. |
I've created a (very basic) example project to demonstrate the described issues. So far I have not managed to test if Kratos correctly redirects to Hydra after a successful login, if the login flow doesn't use the JSON API. |
The oauth2_login_request field was missing when initially creating the login flow. Closes #3108
@vinckr @CaptainStandby Thank you for addressing this issue, should i create a separate issue (or rather discussion) for the redirect after login topic? |
Preflight checklist
Describe the bug
I'm trying to use the Hydra integration via the
login_challenge
argument for Kratos,but the resulting responses are not what I would expect based on the API documentation.
to the
oauth2_login_request
field of the login flow, but this field is only present if the flow is (re-)requested viagetLoginFlow
.redirect_to
URL which will be returned from Hydra via theacceptOAuth2LoginRequest
request.Reproducing the bug
oauth2_login_request
field missing increateBrowserLoginFlow
responseflow = createBrowserLoginFlow({ loginChallenge: 'login_challenge' })
oauth2_login_challenge
field butoauth2_login_request
isn't setflow = getLoginFlow({ id: flow.id })
oauth2_login_challenge
andoauth2_login_request
fieldsredirect_browser_to
after login withlogin_challenge
flow = createBrowserLoginFlow({ loginChallenge: 'login_challenge' })
flow = updateLoginFlow({ flow: flow.id, updateLoginFlowBody: { ... }})
flow
will now be theSuccessfulNativeLogin
response instead ofbrowser_location_change_required
Relevant log output
Relevant configuration
Version
v0.11.1
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes
Additional Context
The
createBrowserLoginFlow
(selfservice/flow/login/handler.go) function requests the Hydra login request and checks it, but seemingly doesn't add it the flow. But thegetLoginFlow
(selfservice/flow/login/handler.go) function does add the Hydra login request as field.kratos/selfservice/flow/login/handler.go
Lines 542 to 551 in 3d07161
The text was updated successfully, but these errors were encountered: