Configuration

class Configuration(providers: List<AuthenticationProvider>)

Authentication configuration

Constructors

Link copied to clipboard
fun Configuration(providers: List<AuthenticationProvider> = emptyList())

Functions

Link copied to clipboard
fun provider(name: String? = null, configure: AuthenticationProvider.Configuration.() -> Unit)

Register a provider with the specified name and configure it

Link copied to clipboard
fun register(provider: AuthenticationProvider)

Register the specified provider

Extensions

Link copied to clipboard
fun Authentication.Configuration.basic(name: String? = null, configure: BasicAuthenticationProvider.Configuration.() -> Unit)

Installs Basic Authentication mechanism

Link copied to clipboard
fun Authentication.Configuration.digest(name: String? = null, configure: DigestAuthenticationProvider.Configuration.() -> Unit)

Installs Digest Authentication mechanism

Link copied to clipboard
fun Authentication.Configuration.form(name: String? = null, configure: FormAuthenticationProvider.Configuration.() -> Unit)

Installs Form Authentication mechanism

Link copied to clipboard
fun Authentication.Configuration.oauth(name: String? = null, configure: OAuthAuthenticationProvider.Configuration.() -> Unit)

Installs OAuth Authentication mechanism

Link copied to clipboard
inline fun <T : Principal> Authentication.Configuration.session(name: String? = null, challenge: SessionAuthChallenge<T>)
inline fun <T : Principal> Authentication.Configuration.session(name: String? = null)

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

inline fun <T : Any> Authentication.Configuration.session(name: String? = null, configure: SessionAuthenticationProvider.Configuration<T>.() -> 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