okta-react-native icon indicating copy to clipboard operation
okta-react-native copied to clipboard

Sign in was not authorized (Android)

Open maoapp opened this issue 4 years ago • 22 comments

I’m submitting a:

  • [ ] Bug report

Current behavior

When calling the signIn function from react-native-okta SDK, we’re getting the error: Error: Sign-in was not authorized even when the credentials are correct.

Expected behavior

signIn to be successful

Steps to reproduce

Initialize okta config Call signIn({userName, password})

Extra information

While debugging the app, we realized that there is something that throws this authorization error with this message: Error: Okta Oidc error this is the structure of our oidc object: const oidc = { clientId: config.OKTA_CLIENT_ID, redirectUri: getDeepLink(‘callback’), endSessionRedirectUri: getDeepLink(‘logout’), discoveryUri: config.OKTA_ISSUER_URL + Platform.select({ android: ‘/.well-known/openid-configuration’, ios: ‘’ }), scopes: [ … ], requireHardwareBackedKeyStore: false } This issue is presented only in Android devices (not iOS or Android simulators) and only in our non-prod environment (prod is working as expected). A non-prod version was working 3 days ago and is presenting this issue today, without changes on our code.

maoapp avatar Oct 05 '21 22:10 maoapp

Sorry to hear you're running into issues. Are you able to reproduce this with our sample app?

JayNewstrom avatar Oct 05 '21 22:10 JayNewstrom

Can you also let us know what version of the SDK you're using.

JayNewstrom avatar Oct 05 '21 22:10 JayNewstrom

Having the same issue as @maoapp even though this code works for ios: Package.json => "okta": "^1.0.0"

Error log => Capture d’écran 2021-10-06 à 09 40 07

Config => Capture d’écran 2021-10-06 à 09 40 56

Removing the "await" didn't change the situation. Still works on IOS but not android. However the error changed for android:

Capture d’écran 2021-10-06 à 09 46 11

The images shown above only show part of the errors (I thought only the first lines mattered).

I tried launching the sample projects but can't manage to do so because of issues with "maven"

ThibaudFabvre avatar Oct 06 '21 07:10 ThibaudFabvre

There is no "okta" dependency that I know of. What version of okta-react-native do you have in your package.json?

On Oct 6, 2021, at 01:42, ThibaudFabvre @.***> wrote:

 Having the same issue: "okta": "^1.0.0"

Error log:

Config:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mraible avatar Oct 06 '21 13:10 mraible

The okta-react-native version is 1.4.0

maoapp avatar Oct 06 '21 14:10 maoapp

That version is over a year old. We've made many fixes since then. Could you please try the latest version?

JayNewstrom avatar Oct 06 '21 14:10 JayNewstrom

@JayNewstrom I already did it but now I am stuck on this https://github.com/okta/okta-oidc-js/issues/795

maoapp avatar Oct 06 '21 21:10 maoapp

@JayNewstrom: Sorry took the wrong dependency. My version of okta-react-native is 2.1.1 .

ThibaudFabvre avatar Oct 07 '21 07:10 ThibaudFabvre

Can you confirm you've done this step in your build.gradle?

https://github.com/okta/okta-react-native#add-redirect-scheme

JayNewstrom avatar Oct 07 '21 16:10 JayNewstrom

Yes I did
Capture d’écran 2021-10-08 à 09 41 15

ThibaudFabvre avatar Oct 08 '21 07:10 ThibaudFabvre

I'm not seeing anything obviously wrong. Could you give us steps to recreate this issue?

JayNewstrom avatar Oct 08 '21 15:10 JayNewstrom

I'm sorry but I can't because I just followed the steps described in the tutorial. It worked for a while and since at least last week it just stopped working. If I see anything on my end I'll hit you up.

ThibaudFabvre avatar Oct 12 '21 07:10 ThibaudFabvre

it's weird from my side worked until the last week and its only happening in a dev environment

maoapp avatar Oct 12 '21 22:10 maoapp

I got one more error since this morning that goes with what was already described:

Capture d’écran 2021-10-26 à 10 49 30

I get the same with the sample project: Capture d’écran 2021-10-26 à 11 42 57

The credentials I used are fine I checked again and again. Its simply just not working properly on Android thats all I can tell for now :/.

ThibaudFabvre avatar Oct 26 '21 08:10 ThibaudFabvre

@ThibaudFabvre This is what's happening to me too, iOS and Android https://github.com/okta/okta-react-native/issues/238. FYI @JayNewstrom

filiphosko avatar Oct 27 '21 07:10 filiphosko

Hi guys, You may ignore the warning as it's inherited from okta-auth-js and doesn't affect the app. It'll be fixed in the next major release as fixed is already merged into master.

Is the error reproducible on sample app?

oleggnidets-okta avatar Oct 27 '21 08:10 oleggnidets-okta

Hi @oleggnidets-okta , yes, I tried with the preconfigured sample app I downloaded from Okta's admin interface. Fails on both iOS and Android. I added all the info here https://github.com/okta/okta-react-native/issues/238.

filiphosko avatar Oct 27 '21 10:10 filiphosko

1- My first problem with signIn() not working on Android is no longer true (it works since this morning, don't know why, despite the code not changing on my end).

2- @oleggnidets-okta @filiphosko same on my end for the warning

ThibaudFabvre avatar Oct 27 '21 14:10 ThibaudFabvre

@ThibaudFabvre My problem was that the MFA was enabled for the organization. Maybe that was also the issue on your end since if it started working without any code change that might indicate a change in the configuration in the Okta admin.

filiphosko avatar Oct 29 '21 16:10 filiphosko

Hi Team, I am getting same issue 'Sign in was not authorized' even after correct credentials .I am trying to create custom login page and integrating Okta library . Please help me. Thanks

chinmayk3 avatar Dec 18 '21 16:12 chinmayk3