[SAML NewDot] Add SAML flow for web, mweb, desktop#28372
Conversation
|
Lint is failing Is it ready for external review or wait until https://github.com/Expensify/Web-Expensify/pull/38972 is deployed? |
|
I think this should be on HOLD until Web-E PR is deployed. But yes, It can be reviewed |
|
@situchan you can review the portions under the |
situchan
left a comment
There was a problem hiding this comment.
Am I missing any config? I am trying to follow External step but I am not able to reach SAML page on web. I enabled permission in Permissions.ts
Screen.Recording.2023-10-02.at.7.48.12.AM.mov
|
|
||
| function SAMLSignInPage(props) { | ||
| useEffect(() => { | ||
| window.open(`${CONFIG.EXPENSIFY.SAML_URL}?email=${props.credentials.login}&referer=${CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER}`, '_self'); |
There was a problem hiding this comment.
It's possible that this page can be accessed on native when newDotSAML beta enabled and window.open will crash.
App/src/pages/signin/SignInPage.js
Lines 92 to 96 in 4308871
There was a problem hiding this comment.
🤔 why would it crash? credentials.login is the only portion we'd need to be defined and we'll only show the SAMLEnabledForm (now ChooseSSOOrMagicCode) or intiaite the SAML login (i.e. navigate to that URL immediately) if the login is set.
|
Updated once more! |
|
Code looks good. (lint failing) I started testing with private domain email.
Where can I enable this? |
In expensify.com under Settings > Domains > [Your Domain] > SAML |
I don't find Domains in Settings. Can you please share that url? |
MonilBhavsar
left a comment
There was a problem hiding this comment.
This is open since long. So going to merge this now.
There is an issue with transitioning which will hopefully be fixed by #28984. If not, we can address it in a separate PR
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@NikkiWines @MonilBhavsar Are QA steps internal? |
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 1.3.85-0 🚀
|
|
@kavimuru since |
|
I'll also do some testing on staging just to try things out |
|
The redirect back to NewExpensify isn't working for me on staging, but I think it might be that we need to test this on prod 🤔 looking at the logs now |
|
Going to hide these changes behind a beta so we can test on prod without it causing issues for customers - #29798 |
|
I commented on the beta PR, but I don't think a beta is necessary. Ideally we can test this in a day or so, and I can't think of many downsides to having it accessible to real customers. Worst case, they run into errors and we fix the bug. |
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.85-4 🚀
|
|
🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 1.3.86-0 🚀
|
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.86-5 🚀
|
| )(LogInWithShortLivedAuthTokenPage); | ||
| export default withOnyx({ | ||
| account: {key: ONYXKEYS.ACCOUNT}, | ||
| session: {key: ONYXKEYS.SESSION}, |
There was a problem hiding this comment.
The session prop appears unused. Do you know if it's needed here?
There was a problem hiding this comment.
We can remove it most probably. Seems like we removed the usage, but forgot to remove this key here. /cc @NikkiWines to be double sure
There was a problem hiding this comment.
Ah yes, we can remove this 👍 I can do that as part of #29526 unless you'd like to make a separate PR fro it @roryabraham
There was a problem hiding this comment.
@NikkiWines if you want to do it as part of #29526 that would be great!
| const {translate} = useLocalize(); | ||
|
|
||
| useEffect(() => { | ||
| window.open(`${CONFIG.EXPENSIFY.SAML_URL}?email=${credentials.login}&referer=${CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER}`, '_self'); |
There was a problem hiding this comment.
window.open broke route history and user couldn't go back from SAML page. ref: #29825
Details
Adds support for signing in with SAML on web and mweb.
Fixed Issues
$ #28215
$ #28216
PROPOSAL: N/A Internal
Tests
(Internal)
(for Web, mWeb, desktop)
Go Backoption and confirm you're dropped back on the sign-in page with your email pre-filledContinueUse Magic Codeoption and confirm you get a magic code sent to your emailGo Backand confirm you're back on the sign-in page with your email pre-filledContinueUse Single Sign OnoptionUse Single Sign Onoption(for ios/android)
(External)
(for Web, mWeb, Desktop)
Go Backoption and confirm you're dropped back on the sign-in page with your email pre-filledContinueUse Magic Codeoption and confirm you get a magic code sent to your emailGo Backand confirm you're back on the sign-in page with your email pre-filledContinueUse Single Sign OnoptionUse Single Sign Onoption(for ios/android)
Offline tests
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
SAML Required Flow
web-required.mov
SAML Enabled Flow
web-enabled.mov
Mobile Web - Chrome
SAML Required Flow
SAML Enabled Flow
Simulator.Screen.Recording.-.iPhone.14.-.2023-09-28.at.17.01.20.mp4
Mobile Web - Safari
SAML Required Flow
mweb-required.mp4
SAML Enabled Flow
mweb-enabled.mp4
Desktop
SAML Required Flow
desktop-required.mov
SAML Enabled Flow
desktop-enabled.mov
iOS
SAML Required Flow
Simulator.Screen.Recording.-.iPhone.14.-.2023-10-12.at.18.36.53.mp4
(SAML Enabled is the same as the current magic code flow)
Android
SAML Required Flow
(SAML Enabled is the same as the current magic code flow)