OidcDeviceClient
Factory function to create an OidcDeviceClient with the provided configuration block.
Example:
val client = OidcDeviceClient {
discoveryEndpoint = "https://auth.example.com/.well-known/openid-configuration"
clientId = "my-client-id"
scopes = mutableSetOf("openid", "profile")
}Content copied to clipboard
Return
A configured OidcDeviceClient instance.
Parameters
block
Configuration block applied to OidcClientConfig.
Factory function to create an OidcDeviceClient from a JSON configuration object.
Required OIDC fields are nested under the oidc key. The deviceAuthorizationEndpoint can be overridden via the openId sub-object inside oidc. Example:
{
"log": "STANDARD",
"oidc": {
"clientId": "my-client-id",
"discoveryEndpoint": "https://auth.example.com/.well-known/openid-configuration",
"scopes": ["openid", "profile"],
"redirectUri": "myapp://oauth2redirect",
"acrValues": "urn:mace:incommon:iap:silver",
"par": true,
"additionalParameters": { "max_age": "3600" },
"openId": {
"deviceAuthorizationEndpoint": "https://auth.example.com/device/code",
"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"
}
}
}Content copied to clipboard
Return
A Result containing the configured OidcDeviceClient or an exception if the configuration is invalid.
Parameters
json
The JSON configuration object.