Auth0.swift icon indicating copy to clipboard operation
Auth0.swift copied to clipboard

Error occurred logging into

Open eugene-vovk opened this issue 3 years ago • 2 comments

Checklist

  • [X] The issue can be reproduced in the Auth0.swift sample app (or N/A).
  • [X] I have looked into the README and have not found a suitable solution or answer.
  • [X] I have looked into the API documentation and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

Description

I have a few issues

  1. The user reported that he cannot log in, that the page is constantly reloaded if he logs in via email.
  2. If at the entrance through the Sign up with Apple refresh the screen and log in again, then the error Error occurred logging into appears

I use WebAuthentication.safariProvider()

        let auth0ClientId: String = try PrettyInfoPlistExecutor.value(for: "AUTH0_CLIENT_ID")
        let auth0Domain: String = try PrettyInfoPlistExecutor.value(for: "AUTH0_DOMAIN")
        webAuthentication = Auth0.webAuth(clientId: auth0ClientId, domain: auth0Domain)
            .scope("openid offline_access email update:current_user_metadata")
            .provider(WebAuthentication.safariProvider())
        authentication = Auth0.authentication(clientId: auth0ClientId, domain: auth0Domain)

Reproduction

https://user-images.githubusercontent.com/37621354/192509442-aa8a718c-c185-4f6e-bdb3-2d898fa56758.MP4

https://user-images.githubusercontent.com/37621354/192510326-c94b42cb-6568-4c30-ac39-d5f3eec57dab.MP4

Auth0.swift version

2.3.1

Platform

iOS

Platform version(s)

14.7, 15*, 16.0

Xcode version

Version 14.0 (14A309)

Package manager

CocoaPods

eugene-vovk avatar Sep 27 '22 11:09 eugene-vovk

Hi @YevhenVovk, thanks for raising this.

Widcket avatar Sep 28 '22 13:09 Widcket

Hi, @Widcket Yes, reproduced in your example

On the first issue logs are not displayed

Logs for the second issue. These are the logs from your sample app

ASWebAuthenticationSession:
https://test-dev.auth0.com/authorize?state=d81efAEnSRonbAzxuNKspuocxi-Nlgrz5CW0UsgSKlQ&code_challenge=dIP5dZRQYxRoKVOPoJQ3XHwqORh0ztecKlsyV&redirect_uri=com.test.mobile.develop://test-dev.auth0.com/ios/com.test.mobile.develop/callback&code_challenge_method=S256&response_type=code&scope=openid%20profile%20email&client_id=8UI5xYjyUkY6o&auth0Client=eyJlbnYiJ9


Callback URL:
com.test.mobile.develop://test-dev.auth0.com/ios/com.test.mobile.develop/callback?code=LlqnI37y0VigpSq8OSx5h&state=hKFo2SBmaTM0N3YyYUOjY2lk2SA4VUk1eFlqeVVrWVBBU2xiUnA0OUN5UjhzOTBzM1M2bw


Failed with: Invalid callback URL: 
com.test.mobile.develop://test-dev.auth0.com/ios/com.test.mobile.develop/callback?code=LlqnI37y0VigpSq8OSx5h&state=hKFo2SBmaTM0N3YyYUOjY2lk2SA4VUk1eFlqeVVrWVBBU2xiUnA0OUN5UjhzOTBzM1M2bw

eugene-vovk avatar Sep 30 '22 12:09 eugene-vovk

Hi @Widcket, any updates?

eugene-vovk avatar Oct 05 '22 09:10 eugene-vovk

Hi @YevhenVovk, apologies for the delay.

Looks like you have an invalid callback URL, which suggests a configuration issue –not an SDK issue. I'd suggest checking your Auth0 application's configuration, any Rules/Actions, the configuration of the SDK, etc.

Widcket avatar Oct 06 '22 04:10 Widcket

Closing, as this does not seem to be an SDK issue. Please feel free to ping if you'd prefer to reopen.

Widcket avatar Oct 13 '22 03:10 Widcket