-
-
Notifications
You must be signed in to change notification settings - Fork 963
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
Unable to link accounts when logging in via an OIDC generic provider (Okta) #3635
Comments
Based on the stack trace, it looks like the error is being raised here: kratos/selfservice/strategy/oidc/strategy.go Line 263 in e9ed14f
where it tries to look up the FlowId in the SQL persister. I think I'm using the wrong value for the I'll continue updating this thread as I find out more... |
Looks like I was missing the initial call to I suppose it's obvious in hindsight, but it might be worth mentioning as a "step: 0" in these docs: https://www.ory.sh/docs/self-hosted/kratos/configuration/oidc I appreciate the Slack channel support. Sorry for the false alarm :) |
Hey @modulitos if you have a minute, would you be able to show how you implemented the callback with the For example here's where it parses the state: kratos/selfservice/strategy/oidc/strategy.go Line 163 in 52c7d3b
More context to why I'm asking here if curious: #275 (comment) Thanks a lot for your time! |
Preflight checklist
Ory Network Project
No response
Describe the bug
I'm following these docs for a generic provider (Okta in this case): https://www.ory.sh/docs/kratos/social-signin/generic
and I have my app redirecting to the following URL to sign in via Okta:
https://my-okta-login.example.com/oauth2/v1/authorize?client_id=${oidcClientId}&redirect_uri=${publicKratosBaseUrl}/self-service/methods/oidc/callback/okta-test&response_type=code&scope=email+profile+openid&state=ZDNmYjk2NzktZmUyMS00NTY1LThjNGUtYjg5MzVjNGY1OTJmOnNvbWVkYXRh
A couple things to note about this URL:
redirect_uri
is using the Kratos endpoint:<kratos-public-url>/self-service/methods/oidc/callback/okta-test
which is not documented in the Kratos HTTP API docs, but is referenced in the social-sign-in troubleshooting pageecho -n "d3fb9679-fe21-4565-8c4e-b8935c4f592f:somedata" | basenc --base64url
which outputsZDNmYjk2NzktZmUyMS00NTY1LThjNGUtYjg5MzVjNGY1OTJmOnNvbWVkYXRh
used in the URLBut after logging into Okta, I'm seeing the following error in the Kratos logs and no Kratos cookies are set:
I posted this question on the Ory slack #talk-kratos channel:
https://ory-community.slack.com/archives/C012RJ2MQ1H/p1700644210740809
and I was recommended to file this bug report.
Reproducing the bug
Repro:
http://127.0.0.1:4433/self-service/methods/oidc/callback/okta-test
and OIDC loginhttp://127.0.0.1:8091
, in this case). It's basically an HTML page with a "login" button that redirects to:https://my-okta-login.example.com/oauth2/v1/authorize?client_id=${oidcClientId}&redirect_uri=${publicKratosBaseUrl}/self-service/methods/oidc/callback/okta-test&response_type=code&scope=email+profile+openid&state=ZDNmYjk2NzktZmUyMS00NTY1LThjNGUtYjg5MzVjNGY1OTJmOnNvbWVkYXRh
http://127.0.0.1:4433/self-service/methods/oidc/callback/okta-test?code=<code>&state=<state>
Expected:
I would expect a redirect to my app, on
http://127.0.0.1:8091
, with some kind of cookies set that contain my Okta credentials. Perhaps aory_kratos_session
cookie?Or perhaps some kind of hook should be called, where I have the opportunity to store an access code as a cookie.
Actual:
Kratos handles that
self-service/methods/oidc/callback/okta-test
endpoint, which outputs the logs below, including an error likeNo active session was found in this request
, and returns a 303 which redirects the browser tohttp://127.0.0.1:4455/error?id=<error-uuid>
The browser renders an error message (see attached screenshot)
Relevant log output
Relevant configuration
Version
oryd/kratos:v1.0.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Docker Compose
Additional Context
No response
The text was updated successfully, but these errors were encountered: