OidcClient
Factory function to create an instance of OidcClient with a given configuration.
Return
An instance of OidcClient.
Parameters
block
A lambda with receiver on OidcClientConfig to configure the client.
Factory function to create an instance of OidcClient from a JSON configuration.
Required fields are nested under the oidc key. Example:
{
"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"
}
}
}Content copied to clipboard
Return
A Result containing the OidcClient instance or an error if the configuration is invalid.
Parameters
json
The JSON configuration object.