okta / okta-react-native

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

Sign in was not authorized (Android) #224

Open maoapp opened 3 years ago

maoapp commented 3 years ago

I’m submitting a:

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.

JayNewstrom commented 3 years ago

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

JayNewstrom commented 3 years ago

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

ThibaudFabvre commented 3 years ago

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"

mraible commented 3 years ago

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.

maoapp commented 3 years ago

The okta-react-native version is 1.4.0

JayNewstrom commented 3 years ago

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

maoapp commented 3 years ago

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

ThibaudFabvre commented 3 years ago

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

JayNewstrom commented 3 years ago

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

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

ThibaudFabvre commented 3 years ago

Yes I did

Capture d’écran 2021-10-08 à 09 41 15
JayNewstrom commented 3 years ago

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

ThibaudFabvre commented 3 years ago

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.

maoapp commented 3 years ago

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

ThibaudFabvre commented 2 years ago

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 :/.

filiphosko commented 2 years ago

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

oleggnidets-okta commented 2 years ago

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?

filiphosko commented 2 years ago

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.

ThibaudFabvre commented 2 years ago

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

filiphosko commented 2 years ago

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

chinmayk3 commented 2 years ago

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