Orchestration SDKs

Step 2. Handling URI schemes

PingOne Advanced Identity Cloud PingAM React Native

When a user authenticates with an external identity provider, the provider redirects them back to your app after the sign-in is complete. For the operating system to know which app to open, you must register your app to handle a custom URI scheme that matches the redirect URI configured in Advanced Identity Cloud or PingAM.

Native provider SDKs route this redirect back to your app themselves, and the module uses a browser redirect where no native SDK exists, for example Sign in with Apple on Android.

Registering a URI scheme on both platforms ensures your app can handle these redirects in all cases.

Configuring URI schemes on Android

Define the URI scheme in your app’s android/app/build.gradle file. Add a manifest placeholder in the android.defaultConfig block:

Registering the URI scheme in build.gradle
android {
    defaultConfig {
        manifestPlaceholders["appRedirectUriScheme"] = "myapp"
    }
}

Replace myapp with the custom scheme registered in your AIC configuration. This creates a redirect URI of the form myapp://callback.

Configuring URI schemes on iOS

Add your app’s custom URL scheme to the ios/<YourApp>/Info.plist file so the OS can route the provider redirect back to your app.

Registering the URI scheme in Info.plist
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>myapp</string>
        </array>
    </dict>
</array>

Replace myapp with the scheme registered in your AIC configuration.

If CFBundleURLTypes already exists in your Info.plist, add the new entry to the existing array rather than creating a duplicate key.