Skip to content
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

OKTA-722502 : Same device enrollment flow updates #3632

Merged

Conversation

leemchale-okta
Copy link
Contributor

@leemchale-okta leemchale-okta commented May 23, 2024

Description:

This PR adds the following updates to the Okta Verify enrollment flow in SIW Gen2 & Gen 3:

-Updates to use new translation keys
-Adds the Or set up Okta Verify on this device link on the select enroll channel view when Same device enrollment is available. (this feature relies on the backend change below)

Backend PR to fix samedevice channel option not being included in response:
https://github.com/atko-eng/okta-core/pull/95705

Figma reference: https://www.figma.com/file/ZP8O9yyMXIsnOhyt8yOKcw/OV-local-enrollment-enhancements?type=design&node-id=2728-15464&mode=design&t=mZ4a71AGYREvZH2Q-0

Design approval: https://okta.slack.com/archives/C06NW6QAHLZ/p1721323879609869?thread_ts=1721087617.224389&cid=C06NW6QAHLZ

Downstream test on monolith: https://bacon-go.aue1e.saasure.net/commits?artifact=monolith&author=lee.mchale%40okta.com&branch=LM-OKTA-722502-downstream-test&page=1&pageSize=6&tab=main

Gen 2 Or set up Okta Verify on this device link flow:

Screen.Recording.2024-07-17.at.10.10.07.PM.mov

Gen 3 Or set up Okta Verify on this device link flow:

Screen.Recording.2024-07-17.at.10.36.42.PM.mov

PR Checklist

Issue:

Reviewers:

Screenshot/Video:

Downstream Monolith Build:

@leemchale-okta leemchale-okta force-pushed the LM-same-device-enroll-flow-updates-OKTA-722502 branch from 728a936 to 8534a67 Compare May 24, 2024 20:02
@leemchale-okta leemchale-okta changed the title Lm same device enroll flow updates okta 722502 OKTA-722502 : Same device enrollment flow updates May 28, 2024
@leemchale-okta leemchale-okta force-pushed the LM-same-device-enroll-flow-updates-OKTA-722502 branch from ec767ff to 4e057c2 Compare July 10, 2024 21:20
@leemchale-okta leemchale-okta force-pushed the LM-same-device-enroll-flow-updates-OKTA-722502 branch from 4e057c2 to 1404568 Compare July 15, 2024 20:55
@@ -79,7 +99,7 @@ export default View.extend({
{{#if sameDeviceOVEnrollmentEnabled}}
<li>
<span>{{i18n code="customUri.required.content.download.title" bundle="login"}}</span>&nbsp;
<a href="{{deviceMap.downloadHref}}" target="_blank" id="download-ov" class="orOnMobileLink">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was causing the download link to navigate to the enroll on another device flow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point out where this unwanted behavior was coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah here is where the click event is attached to the Set up on another device link and looks for this classname. Since this download link was using the same classname, that event was being triggered when this link was pressed.

Comment on lines -226 to -238
function createInvisibleIFrame(iFrameId, iFrameSrc) {
const iFrameView = View.extend({
tagName: 'iframe',
id: iFrameId,
attributes: {
src: iFrameSrc,
},
initialize() {
this.el.style.display = 'none';
}
});
return iFrameView;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to ChallengeViewUtil.js

channelSelectionElement.options.format = 'radio';
const { options: { inputMeta: { options = [] } } } = channelSelectionElement;
channelSelectionElement.options.customOptions = options
.filter((opt) => opt.value !== lastSelectedChannel)
.filter((opt) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for samedevice to be the only enrollment option? If so, channelSelectionElement.options.customOptions[0].value below will fail

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is possible for samedevice to be the only channel, but that is only when OV security setting is set to HIGH. In that case, the user would not have to option to navigate to this channel selection screen anyway, so It probably wouldnt be a problem. But I have added a safeguard if condition just to be safe.

Comment on lines +40 to +41
sameDeviceChannelField.options = sameDeviceChannelField.options?.filter((option) =>
option.value === sameDeviceChannel);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern here about the filtered result in the event that samedevice is the only channel. Will that cause issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think it should be an issue because the user should not have access to the channel selection screen; when samedevice is the only channel, that means OV security is set to HIGH. The Or set up Okta Verify on a mobile device link to enroll in other channels will not display when security is set to HIGH

Comment on lines -125 to -127
if (!this.settings.get('features.sameDeviceOVEnrollmentEnabled')) {
this.add(SwitchEnrollChannelLinkView, 'form');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the conditional is gone, what is the impact of this change?

Copy link
Contributor Author

@leemchale-okta leemchale-okta Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now with this change the switch channel link will display on the enrollment channel page (sms, email etc. ) when the
sameDeviceOVEnrollmentEnabled feature is enabled.

Screenshot 2024-07-18 at 3 59 12 PM

which matches the figma here: https://www.figma.com/file/ZP8O9yyMXIsnOhyt8yOKcw/OV-local-enrollment-enhancements?type=design&node-id=2728-15464&mode=design&t=mZ4a71AGYREvZH2Q-0

Comment on lines +17 to +21
// do not show the 'samedevice' radio option, that option is displayed as a link instead
channelField.options = _.filter(channelField?.options, (option) => (
option.value !== this.options.appState.get('currentAuthenticator')?.contextualData?.selectedChannel
&& option.value !== 'samedevice'
));
Copy link
Contributor

@shawyu-okta shawyu-okta Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my comment in SameDeviceEnrollLink should actually have been here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think it should be an issue because the user should not have access to the channel selection screen; when samedevice is the only channel, that means OV security is set to HIGH. The Or set up Okta Verify on a mobile device link to enroll in other channels will not display when security is set to HIGH

text: string;
};

const ListItemText: FunctionComponent<ListItemTextProps> = ({ text }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker at all, but is there much value in this component compared to inserting the useHtmlContentParser hook in List? This is essentially a thin wrapper around that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was not able to use the useHtmlContentParser hook in List without getting the
React Hook "useHtmlContentParser" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function react-hooks/rules-of-hooks error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In List.tsx there already is usage of a hook useOdysseyDesignTokens() - why is this hook not allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im questioning whether useHtmlContentParser even needs to be a hook, seems to just act like a normal function that parses some text on the spot. Maybe we could just treat it as a regular function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leemchale-okta you're right - let's move this to another directory (maybe there's something for utils) and rename it so it doesn't get picked up by the linter for hooks rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah agreed sounds good will get that refactored.

slack discussion ref: https://okta.slack.com/archives/C04NYNLLRDL/p1721768477843139

@@ -199,7 +199,7 @@ exports[`okta-verify-enrollment-version-upgrade should render form 1`] = `
<li
class="MuiListItem-root emotion-33"
>
On your mobile device, download the Okta Verify app from the App Store (iPhone and iPad) or Google Play (Android devices).
On your other device, download the Okta Verify app from the App Store® (iPhone® and iPad®) or on Google Play (Android? devices).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to check the translation string here - "Android" has a ? showing here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@shawyu-okta shawyu-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the downstream monolith is passing before merging since there's some classname changes to the Gen2 widget in this PR

@oktapp-aperture-okta oktapp-aperture-okta bot merged commit e07d0c5 into master Jul 26, 2024
1 check passed
@oktapp-aperture-okta oktapp-aperture-okta bot deleted the LM-same-device-enroll-flow-updates-OKTA-722502 branch July 26, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants