AuthenticationConfig

class AuthenticationConfig(providers: Map<String?, AuthenticationProvider> = emptyMap())(source)

A configuration for the Authentication plugin.

Report a problem

Constructors

Link copied to clipboard
constructor(providers: Map<String?, AuthenticationProvider> = emptyMap())

Functions

Link copied to clipboard

Installs the basic Authentication provider. You can use basic authentication for logging in users and protecting specific routes. To learn how to configure it, see Basic authentication.

fun AuthenticationConfig.basic(name: String? = null, description: String? = null, configure: BasicAuthenticationProvider.Config.() -> Unit)

Installs the basic Authentication provider with description. You can use basic authentication for logging in users and protecting specific routes. To learn how to configure it, see Basic authentication.

Link copied to clipboard

Installs the Bearer Authentication provider. Bearer auth requires the developer to provide a custom 'authenticate' function to authorize the token and return the associated principal.

fun AuthenticationConfig.bearer(name: String? = null, description: String? = null, configure: BearerAuthenticationProvider.Config.() -> Unit)

Installs the Bearer Authentication provider with description. Bearer auth requires the developer to provide a custom 'authenticate' function to authorize the token and return the associated principal.

Link copied to clipboard

Installs the digest Authentication provider. To learn how to configure it, see Digest authentication.

fun AuthenticationConfig.digest(name: String? = null, description: String? = null, configure: DigestAuthenticationProvider.Config.() -> Unit)

Installs the digest Authentication provider with description. To learn how to configure it, see Digest authentication.

Link copied to clipboard

Installs the form-based Authentication provider. Form-based authentication uses a web form to collect credential information and authenticate a user. To learn how to configure it, see Form-based authentication.

fun AuthenticationConfig.form(name: String? = null, description: String? = null, configure: FormAuthenticationProvider.Config.() -> Unit)

Installs the form-based Authentication provider with description. Form-based authentication uses a web form to collect credential information and authenticate a user. To learn how to configure it, see Form-based authentication.

Link copied to clipboard

Installs the OAuth Authentication provider. OAuth can be used to authorize users of your application by using external providers, such as Google, Facebook, Twitter, and so on. To learn how to configure it, see OAuth.

fun AuthenticationConfig.oauth(name: String? = null, description: String? = null, configure: OAuthAuthenticationProvider.Config.() -> Unit)

Installs the OAuth Authentication provider with description. OAuth can be used to authorize users of your application by using external providers, such as Google, Facebook, Twitter, and so on. To learn how to configure it, see OAuth.

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

Registers a provider with the specified name and allows you to configure it.

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

Registers a provider with the specified name and description and allows you to configure it.

Link copied to clipboard

Registers the specified provider.

Link copied to clipboard
inline fun <T : Any> AuthenticationConfig.session(name: String? = null)
inline fun <T : Any> AuthenticationConfig.session(name: String? = null, noinline configure: SessionAuthenticationProvider.Config<T>.() -> Unit)
fun <T : Any> AuthenticationConfig.session(name: String? = null, kClass: KClass<T>)

Installs the session Authentication provider. This provider provides the ability to authenticate a user that already has an associated session.

inline fun <T : Any> AuthenticationConfig.session(name: String?, description: String?, kClass: KClass<T>, configure: SessionAuthenticationProvider.Config<T>.() -> Unit)

Installs the session Authentication provider with description. This provider provides the ability to authenticate a user that already has an associated session.