Orchestration SDKs

Step 2. Handling URI schemes

PingOne 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 return URL you configured in your DaVinci flow in Configuring social sign-on in PingOne.

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 a custom scheme specific to your apps.

This creates a redirect URI of the form myapp://callback, which the External IdP module uses on devices that do not support Auth Tabs and fall back to Custom Tabs.

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 custom scheme specific to your apps.

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

Matching the redirect URI in your client

In step 4, you pass a redirectUri to the createExternalIdpClient function.

Use the custom scheme you registered here, for example myapp://callback.

On Android, when you omit the redirectUri, the External IdP module falls back to the appRedirectUriScheme manifest placeholder you registered above.