Configuring the DaVinci module in React Native
PingOne React Native
You must configure a DaVinci client to connect to your PingOne instance.
To configure a client, call createDaVinciClient() and provide the OIDC configuration in the modules property:
import { createDaVinciClient } from '@ping-identity/rn-davinci';
const davinciClient = createDaVinciClient({
modules: {
oidc: {
clientId: '6c7eb89a-66e9-ab12-cd34-eeaf795650b2',
discoveryEndpoint: 'https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration',
redirectUri: 'org.forgerock.demo://oauth2redirect',
scopes: ['openid', 'profile', 'email'],
},
},
timeout: 30000,
});
Update the following properties with values that match your environment:
- clientId
-
The client ID from the OAuth 2.0 application you created in PingOne.
For example,
6c7eb89a-66e9-ab12-cd34-eeaf795650b2 - discoveryEndpoint
-
The OIDC discovery endpoint for your PingOne environment.
For example,
https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration. - redirectUri
-
The redirect URI configured in the OAuth 2.0 application.
This value must exactly match a redirect URI configured in PingOne.
For example,
org.forgerock.demo://oauth2redirect - scopes
-
The OIDC scopes to request. The example requests the
openid,profile, andemailscopes. - timeout
-
The maximum time, in milliseconds, that the client waits for a response from the server.
Default is
15000(15 seconds).
Configuring logging
If you installed the @ping-identity/rn-logger package, create a logger and pass it to the client configuration:
import { logger } from '@ping-identity/rn-logger';
const davinciClient = createDaVinciClient({
logger: logger({ level: 'debug' }),
modules: {
oidc: {
clientId: '6c7eb89a-66e9-ab12-cd34-eeaf795650b2',
discoveryEndpoint: 'https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration',
redirectUri: 'org.forgerock.demo://oauth2redirect',
},
},
});
Pass the level parameter to configure the amount of detail the Orchestration SDK outputs. Choose from, debug, info, warn, error, or none.