AuthenticationConfig

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

A configuration for the Authentication plugin.

Constructors

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

Functions

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.

Link copied to clipboard
fun register(provider: AuthenticationProvider)

Registers the specified provider.

Extensions

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

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.

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

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

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

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.

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

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.

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

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