Ping provides these React Native samples to help demonstrate SDK functionality/implementation. They are provided "as is" and are not official products of Ping and are not officially supported.
This repository contains an example React Native project demonstrating OIDC (redirect) authentication using the Ping Orchestration SDK for React Native. Can be used with PingOne Advanced Identity Cloud, PingOne and PingAM.
- Node.js >= 18
- React Native CLI environment set up for iOS and Android
- Xcode: Latest version recommended (iOS 16+)
- Android Studio: Latest version recommended with Java 17 (Android API level 29+)
- Ruby >= 3.3.6 + Bundler (iOS only)
- Ping AIC, PingAM or PingOne server
-
Configure Ping Services: Register an OAuth 2.0 / OIDC application for native mobile apps. Refer to the official Server Configuration Guide for more details.
-
Clone the repository:
git clone https://github.com/ForgeRock/sdk-sample-apps.git cd sdk-sample-apps/reactnative/reactnative-oidc -
Configure the app: Copy the example env file and fill in your server details.
cp .env.example .env
Locate the TODO comment in
.env.exampleand replace the placeholder values in.envwith your configuration. -
Redirect URI: the app's redirect URI scheme is pre-wired to
org.forgerock.oidc://oauth2redirect. If you pick a different scheme, update the redirect URI values in.env,manifestPlaceholders["appRedirectUriScheme"]inandroid/app/build.gradle, and theoauth2redirectentry ofCFBundleURLTypesinios/PingSampleApp/Info.plist. -
Install dependencies:
yarn install
-
iOS only — install CocoaPods:
cd ios bundle install bundle exec pod install cd ..
-
Android only — keystore setup:
android/app/build.gradlesigns the debug build withandroid/app/debug.keystoreusing the aliasandroiddebugkey, and reads the keystore/key passwords from Gradle properties namedKEYSTORE_PASSWORDandKEY_PASSWORD, which aren't set anywhere in this repo. Generate your own debug keystore with that filename and alias:keytool -genkeypair -v \ -keystore android/app/debug.keystore \ -alias androiddebugkey \ -keyalg RSA -keysize 2048 -validity 10000 \ -storepass <your-password> -keypass <your-password> \ -dname "CN=Android Debug,O=Android,C=US"
Then add your credentials to your global
~/.gradle/gradle.properties(create the file if it doesn't exist):KEYSTORE_PASSWORD=<your-password> KEY_PASSWORD=<your-password>
Skipping this step causes the build to fail signing, which then fails app installation.
-
Run the app:
yarn ios # or yarn android
This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.
© Copyright 2024-2026 Ping Identity Corporation. All rights reserved.