okta / okta-react-native

OIDC enablement for React Native applications
https://github.com/okta/okta-react-native
Other
58 stars 39 forks source link

"Error not specified." if the device does not have a browser that supports chrome custom tabs #286

Open SMJ93 opened 2 years ago

SMJ93 commented 2 years ago

Describe the bug?

In the okta-oidc-android documentation it says the okta library only supports Chrome custom tab enabled browsers.

We have been running some tests on our app as lots of users have been complaining about login on Android and here are our findings: Screenshot 2022-03-11 at 10 19 07

We have since added the browserMatchAllFlag which will hopefully improve things.

Unfortunately this still doesn't help if the user does not have a browser that support Chrome custom tabs. e.g. On a OnePlus phone with only DuckDuckGo.

When trying to login with Google via the browser in this scenario with:

import * as OktaRN from "@okta/okta-react-native";

OktaRN.signInWithBrowser({ idp })

it returns the following error:

Screenshot 2022-03-11 at 10 25 21

What is expected to happen?

It should return a specific error like:

code: 1234,
message: "No browser with Chrome custom tabs found"

This would allow us to handle it more appropriately in the app and let the user know they need to install Chrome to login with Google.

What is the actual behavior?

It returns a generic error:

message: "Error not specified."

Reproduction Steps?

On any Android device install DuckDuckGo browser from Google Play, set it as the default browser and remove all other browsers.

When trying to login with Google via the browser in this scenario with:

import * as OktaRN from "@okta/okta-react-native";

OktaRN.signInWithBrowser({ idp })

it returns the following error:

Screenshot 2022-03-11 at 10 25 21

Additional Information?

No response

SDK Version

"@okta/okta-react-native": "2.3.0"

Build Information

No response

JayNewstrom commented 2 years ago

Hi @SMJ93, thanks for the deep dive. I'm noticing it looks like some browsers don't support chrome custom tabs, and it looks like the OnePlus device acts completely different than the rest. I don't have a OnePlus device handy to reproduce this though.

In general, we recommend using Chrome, as that's what we use for testing.

It sounds like the ask here is to provide better error messages, and I'll admit, that's an error that we can be inconsistent in.

I've added a ticket to our backlog to improve error messaging here: OKTA-478919

SMJ93 commented 2 years ago

Hi @JayNewstrom, thanks for getting back so quickly!

Yeah most of us use Chrome ourselves, but lots of our customers don't so are complaining about the issue unfortunately.

Better error messaging would be great! Any idea how long it will take to implement?

JayNewstrom commented 2 years ago

I'm sorry, we don't give timeframes for updates.

JayNewstrom commented 2 years ago

Hi @SMJ93 I've been testing with a bunch of these browsers in our new SDK https://github.com/okta/okta-mobile-kotlin

And it's looking like support is going to be much better. However, given your tests above, you had lots of issues with the OnePlus device. Would you be able to give the sample in that repo a try to see if things are properly working on OnePlus devices?

SMJ93 commented 2 years ago

Hi @JayNewstrom, will @okta/okta-react-native be updated to use this new SDK?

JayNewstrom commented 2 years ago

Hi @SMJ93 we do plan to update our cross platform SDKs to use the new mobile SDKs. But no timeline yet.