Configuring the DaVinci module
PingOne iOS
Configure DaVinci module for iOS properties to connect to PingOne and step through an associated DaVinci flow.
There are two methods for configuring the DaVinci module:
- Full configuration
-
Use the Swift builder closure to access all available settings, including iOS-specific options such as keychain access groups, custom HTTP clients, and storage configuration.
- Common JSON configuration
-
Use a shared key-value structure that works identically across Android, iOS, and JavaScript, letting you load a single config file across platforms.
Full configuration
The following shows an example DaVinci module configuration, using the underlying Oidc module:
let davinciClient = DaVinci.createDaVinci { config in
config.logger = LogManager.standard
// Oidc as module
config.module(OidcModule.config) { oidcValue in
oidcValue.clientId = "6c7eb89a-66e9-ab12-cd34-eeaf795650b2"
oidcValue.discoveryEndpoint = "https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration"
oidcValue.scopes = ["openid", "profile", "email", "address", "revoke"]
oidcValue.redirectUri = "com.example.demo://oauth2redirect"
oidcValue.par = true
oidcValue.additionalParameters = ["customKey":"customValue"]
}
}
Common JSON configuration
You can provide the same configuration as a JSON-compatible dictionary, which lets you share a single config file across Android, iOS, and JavaScript.
DaVinci module from a JSON dictionarylet json: [String: Any] = [
"timeout": 30000, // milliseconds
"log": "WARN",
"oidc": [
"clientId": "6c7eb89a-66e9-ab12-cd34-eeaf795650b2",
"discoveryEndpoint":
"https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration",
"scopes": ["openid", "profile", "email", "revoke"],
"redirectUri": "com.example.demo://oauth2redirect"
]
]
switch DaVinci.createDaVinci(json: json) {
case .success(let davinciClient):
// use davinciClient
case .failure(let error):
// handle configuration error
}
Optionally, you can store this JSON in a file alongside your app and load it at runtime so the same file can be shared across platforms.
|
The JSON factory and the native If you need iOS-specific settings such as keychain access groups, |
Configuration property reference
The following properties are available when configuring the DaVinci module for iOS.
The JSON property column shows the equivalent key when using JSON configuration.
| Property | JSON property | Description | Required? | ||
|---|---|---|---|---|---|
|
|
Specify which logger the Orchestration SDK should use to output messages. Select from the built-in presets You can also create and use your own logger implementation. Learn more in Customizing logging on iOS. In JSON configuration, use the |
No |
||
|
|
A timeout, in seconds, for each request that communicates with the server. Default is When using JSON configuration, specify
|
No |
||
|
|
Request which flow the PingOne server uses by adding an Authentication Context Class Reference (ACR) parameter. Enter a single DaVinci policy by using its flow policy ID. Example:
|
No |
||
|
|
Add additional key-pair parameters as query strings to the initial OAuth 2.0 call to the For example,
|
No |
||
|
|
The For example, |
Yes |
||
|
|
Your PingOne server’s Example:
|
Yes |
||
|
|
Whether to use Pushed Authorization Requests (PAR) for communicating with the authorization server. Learn more in Securing OIDC sign-on with Pushed Authorization Requests. |
No |
||
|
|
The
For example, |
Yes |
||
|
|
A set of scopes to request when performing an OAuth 2.0 authorization flow. For example, |
Yes |
||
|
|
How the authorization server should display the authentication UI.
|
No |
||
|
|
A hint to pre-populate the username field on the authorization server’s sign-on page. For example, |
No |
||
|
|
A value to associate with the ID token to prevent replay attacks. If not set, the SDK generates a nonce automatically. |
No |
||
|
|
Controls whether the authorization server prompts the user for re-authentication or consent. Select one of the following:
|
No |
||
|
|
The number of seconds before token expiry at which the SDK proactively refreshes the token. Defaults to |
No |
||
|
|
The URI to redirect to after sign-out. Maps to the This value must be registered in your OAuth 2.0 client. |
No |
||
|
|
Space-separated BCP 47 language tags indicating the preferred display language for the authorization server’s UI. For example, |
No |