{"id":20307307,"url":"https://github.com/oktadev/okta-react-native-login-example","last_synced_at":"2025-06-20T03:41:53.049Z","repository":{"id":53524717,"uuid":"212649199","full_name":"oktadev/okta-react-native-login-example","owner":"oktadev","description":"A React Native Login Example","archived":false,"fork":false,"pushed_at":"2021-03-26T03:58:32.000Z","size":559,"stargazers_count":6,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-25T11:11:34.947Z","etag":null,"topics":["authentication","enzyme","login","oidc","react-native"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2019/11/14/react-native-login","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oktadev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-03T18:22:41.000Z","updated_at":"2021-03-26T03:58:34.000Z","dependencies_parsed_at":"2022-09-01T13:23:11.361Z","dependency_job_id":null,"html_url":"https://github.com/oktadev/okta-react-native-login-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-login-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-login-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-login-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-login-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-react-native-login-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429104,"owners_count":21101783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","enzyme","login","oidc","react-native"],"created_at":"2024-11-14T17:17:09.535Z","updated_at":"2025-04-11T15:10:37.415Z","avatar_url":"https://github.com/oktadev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Login Example\n\nThis example app shows how to create a React Native application and add Login with Okta.\n\nTo see how this example was created, please read [Create a React Native App with Login in 10 Minutes](https://developer.okta.com/blog/2019/11/14/react-native-login).\n\n**Prerequisites:** [Node.js](https://nodejs.org/), [React Native CLI](https://www.npmjs.com/package/react-native-cli), and Xcode (for iOS/Mac) or Android Studio (for Android).\n\n\u003e [Okta](https://developer.okta.com/) has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application.\n\n* [Getting Started](#getting-started)\n* [Links](#links)\n* [Help](#help)\n* [License](#license)\n\n## Getting Started\n\nTo install this example application, run the following commands:\n\n```bash\ngit clone https://github.com/oktadeveloper/okta-react-native-login-example.git react-native-login\ncd react-native-login\n```\n\nThis will get a copy of the project installed locally.\n\n### Create Native Application in Okta\n\nBefore you can run this React Native example, you'll need a free Okta developer account. Install the [Okta CLI](https://cli.okta.com/) and run `okta register` to sign up for a new account. If you already have an account, run `okta login`.\n\nThen, run `okta apps create`. Select the default app name, or change it as you see fit. Choose **Native** and press **Enter**.\n\nUse `com.okta.dev-133337:/callback` for the Redirect URI and the Logout Redirect URI (where `dev-133337.okta.com` is your Okta domain name). Your domain name is reversed to provide a unique scheme to open your app on a device.\n\nThe Okta CLI will create an OIDC Native App in your Okta Org. It will add the redirect URIs you specified and grant access to the Everyone group. You will see output like the following when it's finished:\n\n```shell\nOkta application configuration:\nIssuer:    https://dev-133337.okta.com/oauth2/default\nClient ID: 0oab8eb55Kb9jdMIr5d6\n```\n\nNOTE: You can also use the Okta Admin Console to create your app. See [Create a Native App](https://developer.okta.com/docs/guides/sign-into-mobile-app/-/create-okta-application/) for more information.\n\n### Specify Your Issuer, Client ID, and Redirect URI\n\nOpen `auth.config.js` and configure OIDC with your settings.\n\n```js\nexport default {\n  oidc: {\n    clientId: '{yourClientId}',\n    redirectUri: 'com.okta.dev-######:/callback',\n    endSessionRedirectUri: 'com.okta.dev-######:/callback',\n    discoveryUri: 'https://dev-######.okta.com/oauth2/default',\n    scopes: ['openid', 'profile', 'offline_access'],\n    requireHardwareBackedKeyStore: false,\n  },\n};\n```\n\nUpdate `android/app/build.gradle` to replace the redirect scheme (`com.okta.dev-######`) with the one that matches your native app's redirect URI.\n\n### Run the App\n\nTo run the app on iOS, you'll first need to install CocoaPods:\n\n```bash\nsudo gem install cocoapods\n```\n\nThen, run `pod install --project-directory=ios`. You can run the following command to start and deploy the app into iOS Simulator.\n\n```bash\nnpm run ios\n```\n\nTo run the app on Android, you'll have to an Android Virtual Device (AVD). Open Android Studio, select open existing project, and choose the `android` directory in your cloned project. If you're prompted to update anything, approve it.\n\nTo create a new AVD, navigate to **Tools** \u003e **AVD Manager**. Create a new Virtual Device and run it.\n\n```bash\nnpm run android\n```\n\n## Links\n\nThis example uses the following libraries:\n\n* [Okta React Native SDK](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react-native)\n* [OktaDev Schematics](https://github.com/oktadeveloper/schematics)\n\n## Help\n\nPlease post any questions as comments on [the blog post](https://developer.okta.com/blog/2019/11/14/react-native-login), as issues in this project, or visit our [Okta Developer Forums](https://devforum.okta.com/).\n\n## License\n\nApache 2.0, see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-react-native-login-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-react-native-login-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-react-native-login-example/lists"}