AuthenticationContext

class AuthenticationContext(call: ApplicationCall)

Represents an authentication context for the call

Parameters

call

instance of ApplicationCall this context is for

Constructors

Link copied to clipboard
fun AuthenticationContext(call: ApplicationCall)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Requests a challenge to be sent to the client if none of mechanisms can authenticate a user

Link copied to clipboard
fun error(key: Any, cause: AuthenticationFailedCause)

Appends an error to the errors list. Overwrites if already registered for the same key.

Link copied to clipboard
inline fun <T : Principal> principal(): T?

Retrieves a principal of type T, if any

fun principal(principal: Principal)

Sets an authenticated principal for this context.

Properties

Link copied to clipboard
val allErrors: List<AuthenticationFailedCause.Error>

All registered errors during auth procedure (only AuthenticationFailedCause.Error).

Link copied to clipboard
val allFailures: List<AuthenticationFailedCause>

All authentication failures during auth procedure including missing or invalid credentials

Link copied to clipboard
val call: ApplicationCall
Link copied to clipboard
val challenge: AuthenticationProcedureChallenge

Gets an AuthenticationProcedureChallenge for this context

Link copied to clipboard
val errors: HashMap<Any, AuthenticationFailedCause>

Stores authentication failures for keys provided by authentication mechanisms

Link copied to clipboard
var principal: Principal?

Retrieves authenticated principal, or returns null if no user was authenticated