Skip to content

interaction required #104

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

Closed
wants to merge 6 commits into from
Closed

interaction required #104

wants to merge 6 commits into from

Conversation

swiftone
Copy link
Contributor

@swiftone swiftone commented Apr 1, 2021

This adds the option to pass an onAuthResume function param to <LoginCallback>, which will be called when the callback gets an interaction_required error redirect.

The callback will most often redirect to the login path to resume the login (in particular if using the widget, which will automatically resume).

// Start login if app has decided it is not logged in and there is no pending signin
if(!authState.isAuthenticated && !authState.isPending) {
handleLogin();
}
} catch (err) {
console.log(err);
Copy link
Contributor

Choose a reason for hiding this comment

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

intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, nope, overlooked debugging. good catch.

README.md Outdated

#### onAuthResume

In special cases where an external auth (such as a social IDP) redirects back to your application AND your Okta sign-in policies require additional authentication factors before authentication is complete, the redirect to your application redirectUri callback will be an `interaction_required` error. Such an error can be handled like any other error, or you can pass an `onAuthResume` function as a prop to `<LoginCallback>`. `onAuthResume` is expected to handle the `interaction_required`. Most commonly (for this not-common situation) you will want your application to resume the login. If using the Okta SignIn Widget, redirecting to your login route will allow the widget to automatically resume your authentication transaction.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would not describe Social IDP as either "special" or "not common", although it is a new feature for this SDK.

I'm not sure what "handled like any other error" means; let's focus on the fact that this is the signal for your app to resume the auth flow.

When mentioning the widget, let's link to that repo and also mention that you must set the useInteractionCodeFlow option

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 is more than Social IDP, this is Social IDP plus and an additional factor (otherwise the redirection to the redirectUri won't come back as interaction_required. That's uncommon as far as I know, and I was trying to highlight that so most devs know if they need to even consider this feature.

I'm not sure what "handled like any other error" means

That is me trying to find text that will work both before and after the LoginCallback errorComponent is fixed, as well as describe the default behavior if you get interaction_required and haven't provided an onAuthResume function.

also mention that you must set the useInteractionCodeFlow option

I didn't want to mention an as-of-yet undocumented option used on a not-yet-generally-available feature.

I'll take a stab at addressing the points you raise here, but the above can cause some confusion.

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