HttpAuthHeader

sealed class HttpAuthHeader

Describes an authentication header with a mandatory authScheme that usually is a standard AuthScheme.

This can be of type HttpAuthHeader.Single or HttpAuthHeader.Parameterized.

Types

Parameterized

class Parameterized : HttpAuthHeader

Describes a parameterized authentication header that is represented by a set of parameters encoded with encoding.

Parameters

object Parameters

Standard parameters for Parameterized.

Single

class Single : HttpAuthHeader

Describes an authentication header that is represented by a single blob.

Properties

authScheme

val authScheme: String

auth scheme, usually one of AuthScheme

Functions

render

abstract fun render(encoding: HeaderValueEncoding): String

Encodes the header with a specified encoding.

abstract fun render(): String

Encodes the header with the default HeaderValueEncoding for this header.

toString

open fun toString(): String

Encodes the header with the default HeaderValueEncoding for this header.

Companion Object Functions

basicAuthChallenge

fun basicAuthChallenge(
    realm: String,
    charset: Charset?
): Parameterized

Generates an AuthScheme.Basic challenge as a HttpAuthHeader.

digestAuthChallenge

fun digestAuthChallenge(
    realm: String,
    nonce: String = generateNonce(),
    domain: List<String> = emptyList(),
    opaque: String? = null,
    stale: Boolean? = null,
    algorithm: String = "MD5"
): Parameterized

Generates an AuthScheme.Digest challenge as a HttpAuthHeader.

Inheritors

Parameterized

class Parameterized : HttpAuthHeader

Describes a parameterized authentication header that is represented by a set of parameters encoded with encoding.

Single

class Single : HttpAuthHeader

Describes an authentication header that is represented by a single blob.