Conversation
87d7306 to
c5690c8
Compare
c5690c8 to
0ec004c
Compare
0ec004c to
fec27dd
Compare
fec27dd to
8d9f92f
Compare
markstory
left a comment
There was a problem hiding this comment.
Looks good to me. Would be good to get someone from enterprise/ecosystem who is more familiar with our oauth implementation to also take a look
|
|
||
| helper.bind_state("state", state) | ||
| if request.subdomain: | ||
| helper.bind_state("subdomain", request.subdomain) |
There was a problem hiding this comment.
Should a user start and SSO flow, leave the tab open with oauth dance incomplete and then open a second tab, not complete that sso, and then go back and complete the first SSO flow they could end up at the wrong place.
In practice that is unlikely to matter as they should have access to both orgs that they started SSO on.
There was a problem hiding this comment.
@markstory Wouldn't the first SSO fail if the state attributed was regenerated on the second tab? We compare the state values here when the user comes back to Sentry from the authentication provider
sentry/src/sentry/auth/providers/oauth2.py
Lines 105 to 106 in 8d9f92f
There was a problem hiding this comment.
I do agree in practice it shouldn't matter.
maxiuyuan
left a comment
There was a problem hiding this comment.
lgtm, if ur cautious i would ask @RyanSkonnord to take a look as well
|
If you need more help looking at this in the future. I wrote all of the pipeline and oauth stuff |
In #38970, I had updated an OAuth2 provider implementation such that we do per-request customization by dynamically update the callback URL based on if a subdomain is present (e.g.
sentry.sentry.io)The OAuth2 spec on redirect URIs suggests that request-specific data in the callback URL be delegated to the "state" parameter.
I've undid the per-request callback URL changes added in #38970, and instead delegated to the pipeline redis store (using "state" parameter) to propagate any customer domain information.
The request flow for customer domains should look like this:
stateparameter and storeorgslugcustomer domain in pipeline redis store.orgslugcustomer domain from pipeline redis store, and redirect user to https://orgslug.sentry.io/auth/login