AuthenticationConfig

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

A configuration for the Authentication plugin.

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.

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.

Link copied to clipboard

Installs the digest Authentication provider. 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.

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.

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

Registers the specified provider.

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