{"id":13452105,"url":"https://github.com/oktadev/okta-react-native-app-auth-example","last_synced_at":"2025-04-11T15:06:35.499Z","repository":{"id":41820467,"uuid":"119898216","full_name":"oktadev/okta-react-native-app-auth-example","owner":"oktadev","description":"React Native Example that Authenticates with Okta using App Auth","archived":false,"fork":false,"pushed_at":"2023-02-27T19:28:07.000Z","size":162343,"stargazers_count":29,"open_issues_count":6,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-05T11:12:09.380Z","etag":null,"topics":["android","appauth","ios","oauth2","okta","react-native"],"latest_commit_sha":null,"homepage":"https://developer.okta.com/blog/2018/03/16/build-react-native-authentication-oauth-2","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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-01T21:52:52.000Z","updated_at":"2024-04-16T20:33:42.000Z","dependencies_parsed_at":"2024-01-16T03:57:28.033Z","dependency_job_id":null,"html_url":"https://github.com/oktadev/okta-react-native-app-auth-example","commit_stats":null,"previous_names":["oktadeveloper/okta-react-native-app-auth-example"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-app-auth-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-app-auth-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-app-auth-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktadev%2Fokta-react-native-app-auth-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktadev","download_url":"https://codeload.github.com/oktadev/okta-react-native-app-auth-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429078,"owners_count":21101782,"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":["android","appauth","ios","oauth2","okta","react-native"],"created_at":"2024-07-31T07:01:13.113Z","updated_at":"2025-04-11T15:06:35.481Z","avatar_url":"https://github.com/oktadev.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# React Native Authentication with App Auth and Okta\n \nThis example app shows how to create a React Native application and authenticate with Okta.\n\n[Click here](RN-README.md) to see the original README that's created by create-react-native-app.\n\nPlease read [Build a React Native Application and Authenticate with OAuth 2.0](https://developer.okta.com/blog/2018/03/16/build-react-native-authentication-oauth-2) to see how this app was created.\n\n**Prerequisites:** [Node.js](https://nodejs.org/) 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-app-auth-example.git\ncd okta-react-native-app-auth-example\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 an application to authorize against. If you don't have an Okta Developer account, [get one today](https://developer.okta.com/signup/)!\n\nLog in to your Okta Developer account and navigate to **Applications** \u003e **Add Application**. Click **Native** and click the **Next** button. Give the app a name you’ll remember (e.g., `React Native`), select `Refresh Token` as a grant type, in addition to the default `Authorization Code`. Copy the **Login redirect URI** (e.g., `com.oktapreview.dev-123456:/callback`) and save it somewhere. You'll need this value when configuring your app.\n\nClick **Done** and you should see a client ID next screen. Copy and save this value as well. \n\n### Specify Your Issuer, Client ID, and Redirect URI\n\nOpen `App.js` and adjust the initialization of `AppAuth` with your settings.\n\n```js\nauth = new AppAuth({\n    issuer: 'https://{yourOktaDomain}.com/oauth2/default',\n    clientId: '{clientId}',\n    redirectUrl: 'com.{yourReversedOktaDomain}:/callback'\n});\n```\n\nUpdate `ios/OktaRN/Info.plist` and `android/app/build.gradle` to replace the redirect scheme (`com.oktapreview.dev-158606`) 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 `cd` into the `ios` directory and run `pod install`. Then 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 **Android** \u003e **AVD Manager**. Create a new Virtual Device and run it. I recommend using Pixel 2 with `Android API 27 x86`.\n \n```bash\nnpm run android\n```\n\n## Links\n\nThis example uses the following libraries:\n\n* [React Native App Auth](https://github.com/FormidableLabs/react-native-app-auth)\n\n## Help\n\nPlease post any questions as issues on this project, or visit our [Okta Developer Forums](https://devforum.okta.com/). You can also email developers@okta.com if would like to create a support ticket.\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-app-auth-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktadev%2Fokta-react-native-app-auth-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktadev%2Fokta-react-native-app-auth-example/lists"}