# React-Native client sdk samples not working

**URL:** <https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852>\
**Category:** Questions\
**Created:** [November 10, 2019, 3:28pm UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852 "2019-11-10T15:28:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixonad](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nixonad/32/1439_2.png) [@nixonad](https://devforum.okta.com/u/nixonad)\
**Post date:** [November 10, 2019, 3:28pm UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852/1 "2019-11-10T15:28:33Z")

</div>

I’m trying to initiate a login from a React-Native app but am having no success with the documentation I’ve been able to find.  
The Samples provided in the guide ([https://developer.okta.com/quickstart/#/react-native/nodejs/express](https://developer.okta.com/quickstart/#/react-native/nodejs/express)), downloaded and executed from github run, but nothing happens when pressing the login button. I also followed the instructions from the readme of the new SDK ([https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react-native](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react-native)) give the same result.  
I’ve also tried using schematics 0.9.0 (following this: [OktaDev Schematics 0.9.0: Now with React Native Support!](https://devforum.okta.com/t/oktadev-schematics-0-9-0-now-with-react-native-support/6397)) which is by far the easiest btw, but this gives a similar result, pressing the login button gives an Authorization Error, -600 error response.  
In no case has the browser has opened to ask for credentials and no activity shows on the Okta logs so it feels like it must be some sort of configuration issue, but I’m at a loss to know what.  
I’ve used the config settings as described in various places, my config looks like this:

```auto
    clientId: '0oa1s762u6H38j0jJ357',
    redirectUri: 'com.okta.dev-686719:/callback',
    endSessionRedirectUri: 'com.okta.dev-686719:/callback',
    discoveryUri: 'https://dev-686719.okta.com/oauth2/default',
    scopes: ['openid', 'profile', 'offline_access'],
    requireHardwareBackedKeyStore: false,

```

Any advice would be much appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [November 10, 2019, 9:43pm UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852/2 "2019-11-10T21:43:53Z")

</div>

This tutorial I wrote last month might help. It worked when I wrote it.

> **[Fun, Fast, and Free Login with React Native](https://scotch.io/tutorials/fun-fast-and-free-login-with-react-native)**
>
> This tutorial shows how to add a login feature to a React Native application using OAuth 2.0 and OpenID Connect.

---

<div class="post-metadata">

**Author:** ![nixonad](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nixonad/32/1439_2.png) [@nixonad](https://devforum.okta.com/u/nixonad)\
**Post date:** [November 11, 2019, 8:18am UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852/3 "2019-11-11T08:18:10Z")

</div>

@mraible: Thanks, very good tutorial… The only real difference between it and the one I used from the okta dev forums on schematics 0.9.0 was the specific versions of schematics, react-native-cli etc. Initially the end result worked identically to the one I did previously (i.e. it did not open the browser window) either in a virtual device or my physical device.

I subsequently went and created a new AVD with the versions you used (Pixel 3, Android 10 and Api v29) and it worked :-). I then also went and deleted and recreated the AVD I was using previously (Pixel 3 with Android 9, API v28) and it also then worked so I’m still unclear as to why it didn’t work previously.

However it still does not work on my physical device which is Android 8, I’m guessing possibly the version is too old. I will also try doing a factory reset and trying again.

One note for your tutorial, when creating the application on Okta, it should be noted that the user _must_ use the default login redirect URI (in the tutorial it’s given as an “e.g.”), otherwise one gets a invalid redirect\_uri error.

Thanks again for your help, for the tutorial and for the schematics scripts, definitely the easiest way to get going.

---

<div class="post-metadata">

**Author:** ![TobiGe](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/tobige/32/1273_2.png) [@TobiGe](https://devforum.okta.com/u/TobiGe)\
**Post date:** [November 25, 2019, 12:44pm UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852/4 "2019-11-25T12:44:29Z")

</div>

Hi @nixonad,

We are running into similar behavior testing our app in a pre-android 9.0 environment.

The tutorial talks about minSdkVersion of 19 (Android 4.4 - KitKat), so we were under the impression Okta-RN would support at least the “officially supported” android versions, (8.0+), but running it on Android 8.0 and 8.1 renders our “sign-in” button useless, as it does not trigger any browser to open.

Any idea if there is additional configuration needed to make it work in these older versions of android?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![nixonad](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nixonad/32/1439_2.png) [@nixonad](https://devforum.okta.com/u/nixonad)\
**Post date:** [November 27, 2019, 9:17am UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852/5 "2019-11-27T09:17:04Z")

</div>

Hi @TobiGe,  
I unfortunately haven’t been able to get mine to work on Android 8 on my physical device, but I haven’t done much further investigation.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 23, 2024, 7:34pm UTC](https://devforum.okta.com/t/react-native-client-sdk-samples-not-working/6852/6 "2024-01-23T19:34:25Z")

</div>

Closed on January 23, 2024, 7:34pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
