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

ios 13 webAuth.authorize silent failure #233

Closed
3 of 4 tasks
robwalkerco opened this issue Sep 2, 2019 · 11 comments · Fixed by #238
Closed
3 of 4 tasks

ios 13 webAuth.authorize silent failure #233

robwalkerco opened this issue Sep 2, 2019 · 11 comments · Fixed by #238

Comments

@robwalkerco
Copy link

Description

I'm trying to test an app on iOS 13. It uses this project to handle the webAuth flow, but seems to silently fail.

Prerequisites

  • Did you check the documentation?
  • Did you check the Auth0 Community?
  • Are you reporting this to the correct repository?
  • Are there any related or duplicate Issues or PRs for this issue?

Environment

Please provide the following:

  • React Native Auth0 version - 1.5.0
  • React Native version 0.39.9
  • iOS Setup - iOS 13
  • Android Setup - n/a

Reproduction

On iOS 12.4 the webAuth.authorize method triggers the "{App} Wants to Use {domain} to Sign In" messaged, followed by the login flow.

On iOS 13 the webAuth.authorize method seems to do nothing. My guess is that its related to the required changes referenced from auth0/Auth0.swift#295

@cocojoe
Copy link
Member

cocojoe commented Sep 4, 2019

@robwalkerco I added a draft PR, be great if you can try the changes in your project, can simply replace the file. Can I just confirm you are using RN 0.39.9? Surprised this runs with no compiler issues in Xcode 11.

@robwalkerco
Copy link
Author

robwalkerco commented Sep 4, 2019 via email

@Bardiamist
Copy link
Contributor

@cocojoe That is very critical. Please release patch as soon as possible.

@draperunner
Copy link

I am having the same problem. Nothing happens when trying to authorize on an iOS 13 simulator. I have tried installing from the latest commit (e8da8e0), but there's no difference.

By adding some logging directly in node_modules, I found something interesting I think:

The NativeModules.A0Auth0.showUrl function never resolves in react-native-auth0/webauth/agent.js lines 22 - 30.

NativeModules.A0Auth0.showUrl(url, closeOnLoad, (error, redirectURL) => {
        Linking.removeEventListener('url', urlHandler);
        if (error) {
          reject(error);
        } else if(redirectURL) {
          resolve(redirectURL);
        } else if(closeOnLoad) {
          resolve();
        }
      });

That's because error, redirectURL and closeOnLoad are null, null and false, respectively.

I guess this is just a consequence of some other error, but I think there should be an else case that rejects the promise with a meaningful error message.

@xeroxoid
Copy link

Related PR: #234

When can we expect a release as there seems to be no way to work around it on 1.5.0?

@Bardiamist
Copy link
Contributor

While maintainers not released new version is possble to use "react-native-auth0": "git+https://github.com/auth0/react-native-auth0.git#e8da8e0b053649af020cdd7018dfc91ef6e8eef1", in package.json.

@vtam311
Copy link

vtam311 commented Oct 24, 2019

For those who need to use an older version of this package because you don't want to upgrade react-native, I fixed this issue by updating this package's ios/A0Auth0.m file.

You can replace that file with: https://github.com/auth0/react-native-auth0/blob/b095109866dc82e4026cc19d23e9b44ce8ff0e37/ios/A0Auth0.m.

Or if you'd like a more controlled approach, you can manually add code from this commit:
b095109

@codeithuman
Copy link

We are experiencing this issue with react-native-auth0 v2.1.0 on react-native 0.60.6 with iOS 13. Any ideas why?

@codeithuman
Copy link

A newly initialized react-native v0.60.6 project works, but our project does not. Still trying to figure it out.

Auth0.webAuth works in 'Debug' mode on iOS, but does not work when the iOS app is built for 'Release'.

@Bardiamist
Copy link
Contributor

Bardiamist commented Dec 12, 2019

@codeithuman 2.1.0 has bad jsrsasign dependency. Maybe that is related. Try 2.0.0.

@ravi-poonia-7
Copy link

Something is wrong, facing the same issue in my RN project. It occurs only on the first attempt after a fresh install, after that it works fine. After I added some logs in the library files, it seems the issue is the same as mentioned below. The showurl function is resolved immediately and the login screen never shows up.

RN: v0.66.4
Auth0: v2.11.0
IOS: 15.2

I have configured the whole setup multiple times just to make sure I'm not doing anything wrong, but the issue is still there.

I am having the same problem. Nothing happens when trying to authorize on an iOS 13 simulator. I have tried installing from the latest commit (e8da8e0), but there's no difference.

By adding some logging directly in node_modules, I found something interesting I think:

The NativeModules.A0Auth0.showUrl function never resolves in react-native-auth0/webauth/agent.js lines 22 - 30.

NativeModules.A0Auth0.showUrl(url, closeOnLoad, (error, redirectURL) => {
        Linking.removeEventListener('url', urlHandler);
        if (error) {
          reject(error);
        } else if(redirectURL) {
          resolve(redirectURL);
        } else if(closeOnLoad) {
          resolve();
        }
      });

That's because error, redirectURL and closeOnLoad are null, null and false, respectively.

I guess this is just a consequence of some other error, but I think there should be an else case that rejects the promise with a meaningful error message.

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 a pull request may close this issue.

8 participants