React-native-auth0: ios 13 webAuth.authorize silent failure

Created on 2 Sep 2019  Â·  10Comments  Â·  Source: auth0/react-native-auth0

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

  • [x] Did you check the documentation?
  • [x] Did you check the Auth0 Community?
  • [x] 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 https://github.com/auth0/Auth0.swift/issues/295

Most helpful comment

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.

All 10 comments

@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.

Ooops. I meant to type 0.59.9!

I'll install xcode-beta again and give it another try. Will let you know
how it goes.

On Wed, 4 Sep 2019, 10:11 Martin Walsh, notifications@github.com wrote:

@robwalkerco https://github.com/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.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/auth0/react-native-auth0/issues/233?email_source=notifications&email_token=ABRY7HWGECCMWVFBREPBHS3QH53T3A5CNFSM4ITAKU52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD525CDQ#issuecomment-527814926,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABRY7HQYW5KL7H2UZQWVSCDQH53T3ANCNFSM4ITAKU5Q
.

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

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.

Related PR: https://github.com/auth0/react-native-auth0/pull/234

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

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.

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:
https://github.com/auth0/react-native-auth0/commit/b095109866dc82e4026cc19d23e9b44ce8ff0e37

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

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'.

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

Was this page helpful?
0 / 5 - 0 ratings