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

Login page does not open sometimes on OS X Monterrey #621

Closed
shuw opened this issue Jan 6, 2022 · 12 comments
Closed

Login page does not open sometimes on OS X Monterrey #621

shuw opened this issue Jan 6, 2022 · 12 comments

Comments

@shuw
Copy link

shuw commented Jan 6, 2022

Describe the problem

On OS X Monterrey (confirmed with, 12.0.1), the browser sign-in page may occasionally not open after clicking "continue". This issue was seen with Safari set as the default browser.

Debugging the issue, the callback from Auth0 does not occur as well. I suspect this could be an issue with Auth0's usage of ASWebAuthenticationSession (which owns that the dialog and the invocation of the browser. There is a report of a related issue on Apple's developer forum: https://developer.apple.com/forums/thread/694465.

What was the expected behavior?

The browser sign-in page is always opened after clicking "continue" in the prompt to sign-in.

Reproduction

  1. Start in a signed-out state
  2. Begin the Auth0 authentication flow
  3. See the dialog "AppX" wants to use "auth0.com" to sign in.
  4. Click continue

Can the behavior be reproduced using the Auth0.swift sample app?
N/A - issue is on MacOS, not iOS

Environment

  • Version of Auth0.swift used: 1.38.0
  • Version of MacOS: 12.0.1
  • Version of Xcode: 13.2
@Widcket
Copy link
Contributor

Widcket commented Jan 6, 2022

Hi @shuw, thanks for raising this. Unfortunately, this seems like an ASWebAuthenticationSession bug on Monterey, and not an Auth0.swift bug. I'll be closing this issue, as it is not actionable by us.

@Widcket Widcket closed this as completed Jan 6, 2022
@shuw
Copy link
Author

shuw commented Jan 6, 2022

@Widcket is there any possibility that Auth0 could support an alternate approach than using ASWebAuthenticationSession on MacOS?

@Widcket
Copy link
Contributor

Widcket commented Jan 6, 2022

Unlike on iOS, ASWebAuthenticationSession is the only way to perform web-based authentication on macOS that does not involve embedding a server to listen for the callback.

@jpr5
Copy link

jpr5 commented Jan 6, 2022

@Widcket Is this the first time this issue has actually been reported? We've been encountering it regularly, and I just have to think that if there's any meaningful macOS+Auth0 @ Monterey install base, they're 100% guaranteed to run into this.

I get the WONTFIX/CANTFIX diagnosis, but shouldn't this rate something more support-wise for the users, given the likelihood of them all experiencing it + the likelihood of the first point of support/blame being Auth0? Like a KB article or FAQ entry or something? Or maybe you folks have a contact at Apple that can elevate attention to it?

@Widcket
Copy link
Contributor

Widcket commented Jan 6, 2022

Hi @jpr5, this is the first time this issue has been reported to us. I'll pin this issue for greater visibility.

@Widcket Widcket pinned this issue Jan 6, 2022
@jpr5
Copy link

jpr5 commented Jan 6, 2022

Thanks, appreciate it.

@sincaleb
Copy link

I hate to just drop in and say "Me Too", but a similar issue happens to us very frequently as well. We are using an ephemeral session so we don't get the prompt, but sometimes the login window just never appears. If we have our users quit safari and quit our catalyst app it functions normally, but its a pretty frequent occurrence and we have been getting a lot of complaints about it. Thanks!

@Kardioversion
Copy link

Could you all put this in the documentation as a "known issue"? Or at least do not close issues that are unresolved?

I scanned this repo a few hours ago and there were zero open issues, so I moved on to other possible causes of this bug. I understand Auth0 is not causing the bug but if your SDK does not work on a major platform (macOS), then I consider that an open issue, even if internally at Auth0 it is not a "we need to fix this issue by writing code" situation.

@shuw
Copy link
Author

shuw commented Mar 25, 2022

For others experiencing this issue and looking for a workaround, my solution was to move off of Auth0's SDK for doing the authentication on OSX.

Instead, I used a library called OAuthSwift to perform the authentication with a regular browser window. And there are 2 ways to receive the authentication token back:

  • Apple Custom URL Scheme (easiest)
  • Build a local HTTP server (I used Swifter) to receive the token back. This approach is more complicated but avoids an extra dialog that comes up when a custom URL scheme is invoked.

@Widcket Widcket reopened this Mar 26, 2022
@Widcket Widcket unpinned this issue May 10, 2022
@Widcket
Copy link
Contributor

Widcket commented Jun 1, 2022

Auth0.swift 2.1.0 added support for custom Web Auth providers, so you can swap the default ASWebAuthenticationSession implementation with something else. This is was done mostly to provide a way to use SFSafariViewController instead of ASWebAuthenticationSession, which is iOS-only, but it can be used to whip up a custom provider for macOS as well.

You'd need to implement the WebAuthUserAgent protocol.

See: https://github.com/auth0/Auth0.swift/blob/master/FAQ.md#1-how-can-i-disable-the-login-alert-box
Example: https://github.com/auth0/Auth0.swift/blob/master/Auth0/SafariProvider.swiftthttps://github.com/auth0/Auth0.swift/blob/master/Auth0/SafariProvider.swift

Screen Shot 2022-06-01 at 11 39 46

@Widcket
Copy link
Contributor

Widcket commented Jun 3, 2022

With the custom Web Auth providers feature there's now a way to work around this issue, so I'll close this one. Please feel free to ping if you'd prefer to reopen.

@manishjain999
Copy link

Login page does not Opens on Monterey when the Chrome browser is set as the Default Browser with Multiple Profiles. This is random when tried on multiple Mac Systems. is this a known issue?

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

5 participants