Configuration

class Configuration

Authentication configuration

Constructors

<init>

Configuration(
    providers: List<AuthenticationProvider> = emptyList())

Authentication configuration

Functions

provider

fun provider(
    name: String? = null,
    configure: Configuration.() -> Unit
): Unit

Register a provider with the specified name and configure it

register

fun register(provider: AuthenticationProvider): Unit

Register the specified provider

Extension Functions

basic

fun Configuration.basic(
    name: String? = null,
    configure: Configuration.() -> Unit
): Unit

Installs Basic Authentication mechanism

digest

fun Configuration.digest(
    name: String? = null,
    configure: Configuration.() -> Unit
): Unit

Installs Digest Authentication mechanism

form

fun Configuration.form(
    name: String? = null,
    configure: Configuration.() -> Unit
): Unit

Installs Form Authentication mechanism

jwt

fun Configuration.jwt(
    name: String? = null,
    configure: Configuration.() -> Unit
): Unit

Installs JWT Authentication mechanism

oauth

fun Configuration.oauth(
    name: String? = null,
    configure: Configuration.() -> Unit
): Unit

Installs OAuth Authentication mechanism

session

fun <T : Principal> Configuration.session(
    name: String? = null,
    challenge: SessionAuthChallenge<T> = SessionAuthChallenge.Default
): Unit

Provides ability to authenticate users via sessions. It only works if T session type denotes Principal as well otherwise use full session with lambda function with SessionAuthenticationProvider.Configuration.validate configuration

fun <T : Any> Configuration.session(
    name: String? = null,
    configure: Configuration<T>.() -> Unit
): Unit

Provides ability to authenticate users via sessions. It is important to have specified SessionAuthenticationProvider.Configuration.validate and SessionAuthenticationProvider.Configuration.challenge in the lambda to get it work property