Package-level declarations

Types

Link copied to clipboard
interface Agent<T>

The Agent is an interface that is used to authenticate and end a session with an OpenID Connect provider.

Link copied to clipboard
@Serializable
data class AuthCode(val code: String = "", val codeVerifier: String? = null)

Data class representing an authorization code.

Link copied to clipboard

Default implementation of the Agent interface.

Link copied to clipboard
open class OidcClient(config: OidcClientConfig)

Class representing an OpenID Connect client.

Link copied to clipboard

Configuration class for OIDC client.

Link copied to clipboard
class OidcConfig<T>

Allow the Agent to run on OidcConfig so that it can access the configuration object.

Link copied to clipboard
sealed class OidcError

Sealed class for OIDC errors.

Link copied to clipboard
class OidcUser(oidcClient: OidcClient) : User

Class for an OIDC User.

Link copied to clipboard
@Serializable
data class OpenIdConfiguration(val authorizationEndpoint: String = "", val tokenEndpoint: String = "", val userinfoEndpoint: String = "", val endSessionEndpoint: String = "", val pingEndIdpSessionEndpoint: String = "", val revocationEndpoint: String = "")

Data class representing the OpenID Connect configuration.

Link copied to clipboard
data class Pkce(val codeVerifier: String, val codeChallenge: String, val codeChallengeMethod: String)

Data class for PKCE (Proof Key for Code Exchange).

Link copied to clipboard
@Serializable
data class Token(val accessToken: String = "", val tokenType: String? = null, val scope: String? = null, val expiresIn: Long = 0, val refreshToken: String? = null, val idToken: String? = null, expireAt: Long = now() + expiresIn)

Data class representing an OIDC token.

Link copied to clipboard
interface User

Interface for a User. Provides methods for token management, user information retrieval, and logout.

Properties

Link copied to clipboard
const val CLIENT_ID: String
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <R> catch(block: () -> R): Result<R, OidcError>

Function to catch and handle exceptions.

Link copied to clipboard
inline fun OidcClient(block: OidcClientConfig.() -> Unit = {}): OidcClient

Factory function to create an instance of OidcClient with a given configuration.