All Downloads are FREE. Search and download functionalities are using the official Maven repository.

invirt.http4k.security.authentication.Authenticator.kt Maven / Gradle / Ivy

There is a newer version: 0.10.11
Show newest version
package invirt.http4k.security.authentication

import org.http4k.core.Request

interface Authenticator {
    /**
     * Authenticates an HTTP request, usually by extracting headers/cookies and returning them as AuthTokens
     * along with the authenticated Principal.
     */
    fun authenticate(request: Request): AuthenticationResponse

    /**
     * Removes persistent session/auth state, or invalidates tokens
     */
    fun logout(request: Request)
}

sealed class AuthenticationResponse {

    data object Unauthenticated : AuthenticationResponse()

    data class Authenticated

(val authentication: Authentication) : AuthenticationResponse() }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy