-
Notifications
You must be signed in to change notification settings - Fork 330
Add sign in with microsoft #13425
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
base: develop
Are you sure you want to change the base?
Add sign in with microsoft #13425
Conversation
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.
CR ✅
// When using Microsoft we need to first invalidate auth0 and windows live sessions before calling cognito. | ||
const session = await amplify.Auth.currentSession() | ||
const identities = session.getIdToken().decodePayload()['identities'] | ||
const providerName = identities?.length ? identities[0]['providerName'] : undefined |
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.
const providerName = identities?.length ? identities[0]['providerName'] : undefined | |
const providerName = identities?.[0]?.['providerName'] |
/** | ||
* Sign in via the Microsoft federated identity provider. | ||
* | ||
* This function will open the GitHub authentication page in the user's browser. The user will |
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.
Comment talks about github
const identities = session.getIdToken().decodePayload()['identities'] | ||
const providerName = identities?.length ? identities[0]['providerName'] : undefined | ||
if (providerName === MICROSOFT_PROVIDER) { | ||
window.open($config.MICROSOFT_SIGN_OUT_URL, '_blank') |
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.
Not calling Auth.signOut()
for microsoft provider here looks incorrect. This at least needs an comment explaining that the expected outcome of opening that window is that we will eventually hit a //auth/federated
deeplink handler.
I believe this logic now introduces a subtle but consequential bug - the promise returned from this function will resolve too early. It won't actually wait for the signOut to happen. The microsoft branch should return a promise that actually waits for the expected deeplink handler to be hit and processed properly. At that point the actual signOut logic could actually continue running in this function, instead of inside the deeplink handler. That would avoid duplication of following code.
Also, what happens if the user closes that window before it had a chance to do anything?
app/gui/.dev-env
Outdated
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.
This reverts a submodule update. Probably by accident?
Pull Request Description
This PR adds a button for users to signing with Microsoft Entra ID.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.