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

SilentSafariViewController dismisses before federated logout can complete #175

Closed
srgray opened this issue Nov 26, 2017 · 6 comments
Closed

Comments

@srgray
Copy link

srgray commented Nov 26, 2017

When performing a federated logout, SilentSafariViewController dismisses before the federated logout can complete. (tested on iOS 10)

I suspect that SilentSafariViewController successfully loads the Auth0 logout page and its delegate method is called to dismiss the controller before the redirect to the federated logout page can occur.

I verified this by placing an arbitrary delay of 1 second before the call to dismiss SilentSafariViewController. In that case, the federated logout did occur successfully. But this arbitrary delay doesn't seem like the correct solution to this issue.

@cocojoe
Copy link
Member

cocojoe commented Nov 27, 2017

Hey @srgray curious what happens when testing in iOS11 and it uses SFAuthenticationSession pathway?

@srgray
Copy link
Author

srgray commented Nov 27, 2017

@cocojoe When testing on iOS11 and using SFAuthenticationSession, the federated logout works properly. I suspect that this is because the SFAuthenticationSession view controller remains visible after the redirect to federated logout page. The user must manually tap 'Cancel' on SFAuthenticationSession to get it to dismiss.

@srgray
Copy link
Author

srgray commented Dec 5, 2017

@cocojoe Any thoughts on this one? Is my assumption correct that the view is dismissing before it can redirect to the federated logout page?

srgray added a commit to srgray/Auth0.swift that referenced this issue Dec 5, 2017
…oller. This allows a redirect to the federated logout page to happen before dismissal.
@cocojoe
Copy link
Member

cocojoe commented Dec 6, 2017

So I tested in iOS 10 using a Google connection (I don't have SAML setup) and saw that it got redirected to google before closing. Now it may well be a timing issue, once the first URL is hit the didLoad callback is executed. It feels like the federated redirect takes place while the didLoad callback is executing. (As I didn't see it load the full page before it dismissed).

SFAuthenticationSession works differently, there is no didLoad callback available. It works using a redirect to the app. It may be when using federated this redirect can get lost, hence the manual close, which also gives it plenty of time to follow redirects regardless of connection speed.

@srgray
Copy link
Author

srgray commented Dec 6, 2017

OK, thanks for checking. For now, I'm going to add an arbitrary delay before the controller dismisses (on my fork of this repo, since it doesn't feel like a good, general solution).

@srgray srgray closed this as completed Dec 6, 2017
@cocojoe
Copy link
Member

cocojoe commented Dec 7, 2017

No problem, yes it's not ideal. That is why you may also want to try adding the prompt=login the next time you use Lock after a Logout.

Lock
                    .classic()
                    .withOptions {
                        applyDefaultOptions(&$0)
                        $0.parameters = ["prompt" : "login"]
}

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

No branches or pull requests

2 participants