AuthenticationContext

class AuthenticationContext

Represents an authentication context for the call

Parameters

call - instance of ApplicationCall this context is for

Constructors

<init>

AuthenticationContext(call: ApplicationCall)

Represents an authentication context for the call

Properties

call

val call: ApplicationCall

instance of ApplicationCall this context is for

challenge

Gets an AuthenticationProcedureChallenge for this context

errors

Stores authentication failures for keys provided by authentication mechanisms

principal

var principal: Principal?

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

Functions

challenge

fun challenge(
    key: Any,
    cause: AuthenticationFailedCause,
    function: PipelineInterceptor<AuthenticationProcedureChallenge, ApplicationCall>
): Unit

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

error

fun error(key: Any, cause: AuthenticationFailedCause): Unit

Appends an error to the errors

principal

fun principal(principal: Principal): Unit

Sets an authenticated principal for this context.

fun <T : Principal> principal(): T?

Retrieves a principal of type T, if any