-
Notifications
You must be signed in to change notification settings - Fork 969
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
fix: check return code of ms graphapi /me request. #2647
Conversation
ba2de70
to
7f0bfaa
Compare
I haven't touched anything that should trigger the linter errors (and am getting very different errors locally in code that I've also not changed), so it seems like they are caused by upstream code. |
The linter errors came from a premature update of the gofmt binary and our use of Open API. I updated the PR, with our state in master. Should be fixed now. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you! 🎉 Your contribution makes Ory better :)
Hello @floriankramer |
Co-authored-by: Jonas Hungershausen <jonas.hungershausen@ory.sh>
When using the microsoft oicd provider and tyring to link an account with insufficient scope (e.g. missing
User.Read
) for the authorization code the request tohttps://graph.microsoft.com/v1.0/me
used to determine the user id fails silently. This request is used when building the Context to get the user id, which is used as a unique identifier for the credentials.The result is that the identifier in the
identity_crendential_identifiers
table ismicrosoft:
. As soon as a second user tries to link their account ory attempts to create a secondcredential identifier with the same identifier ofmicrosoft:
. The linking then fails, and the user logs in as the first user who linked with microsoft if they use microsoft oicd.This pr adds a check to make sure the status code returned from the graph api is 200. There will be a separate pr from a colleague that updates the documentation to make it more clear which scopes are needed for microsoft oicd.
Related issue(s)
Checklist
If this pull request addresses a security. vulnerability,
I confirm that I got green light (please contact security@ory.sh) from the maintainers to push the changes.
Further Comments