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

OIDExternalUserAgentSession flow cannot be resumed from URL after app termination #819

Open
drhaynes-cat opened this issue Feb 15, 2024 · 0 comments

Comments

@drhaynes-cat
Copy link

Describe the bug

I am trying to handle the case where the app has been terminated when an auth flow is in progress. For context, this is using an email magic link flow, so there may be some time between the flow being initiated on the app side, and the link being followed in a user's email client.

What is the best way to handle the scenario where the user taps the one-time link in their email client, but the app is no longer running, and hence there is no current OIDExternalUserAgentSession to use to resume the auth flow from?

Normally you would do something like currentFlow.resumeExternalUserAgentFlow(with: url), but in this case the current flow no longer exists.

This scenario does not appear to be in any of the examples, or documented anywhere I could find.

Is the correct approach to persist the original OIDAuthorizationRequest when the flow is initiated and recreate the flow using:

OIDAuthState.authState(
    byPresenting authorizationRequest: OIDAuthorizationRequest,
    presenting presentingViewController: UIViewController
    callback: @escaping OIDAuthStateAuthorizationCallback
) -> OIDExternalUserAgentSession

Is this even a valid use case? Is the one-time code in the email expected to be immediate use, and so any app termination in the meantime means you have to request another link to authenticate?

Any guidance greatly appreciated.

@drhaynes-cat drhaynes-cat added bug triage Issues that need to be triaged labels Feb 15, 2024
@mdmathias mdmathias added help wanted and removed bug triage Issues that need to be triaged labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants