DaVinci

fun DaVinci(block: DaVinciConfig.() -> Unit = {}): <Error class: unknown class>

Function to create a DaVinci instance. fun main() { val daVinci = DaVinci { module(Oidc) { clientId = "your-client-id" redirectUri = "your-redirect-uri" scopes = listOf("openid", "profile") } } }

Return

The DaVinci instance.

Parameters

block

The configuration block.


fun DaVinci(json: JsonObject): Result<<Error class: unknown class>>

Creates a DaVinci instance from a JSON configuration.

Required OIDC fields are nested under the oidc key. Example:

{
"timeout": 30000,
"log": "STANDARD",
"oidc": {
"clientId": "my-client-id",
"discoveryEndpoint": "https://auth.example.com/.well-known/openid-configuration",
"scopes": ["openid", "profile"],
"redirectUri": "myapp://oauth2redirect",
"signOutRedirectUri": "myapp://logout",
"refreshThreshold": 60,
"loginHint": "user@example.com",
"state": "custom-state",
"nonce": "custom-nonce",
"display": "page",
"prompt": "login",
"uiLocales": "en-US",
"acrValues": "Level3",
"par": true,
"additionalParameters": { "max_age": "3600" },
"openId": {
"authorizationEndpoint": "https://auth.example.com/authorize",
"tokenEndpoint": "https://auth.example.com/token",
"userinfoEndpoint": "https://auth.example.com/userinfo",
"endSessionEndpoint": "https://auth.example.com/logout",
"revocationEndpoint": "https://auth.example.com/revoke"
}
}
}

Return

A Result containing the DaVinci instance or an exception if the configuration is invalid.

Parameters

json

The JSON configuration object.