AuthenticationContext

class AuthenticationContext(call: <ERROR CLASS>)

An authentication context for a call.

Parameters

call

instance of ApplicationCall this context is for.

Constructors

Link copied to clipboard
fun AuthenticationContext(call: <ERROR CLASS>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun challenge(key: Any, cause: AuthenticationFailedCause, function: ChallengeFunction)

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 the 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
var call: <ERROR CLASS>
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 an authenticated principal, or returns null if a user isn't authenticated.