ktor-client-auth / io.ktor.client.features.auth.providers / BasicAuthProvider

BasicAuthProvider

class BasicAuthProvider : AuthProvider

Client basic authentication provider.

Constructors

<init>

BasicAuthProvider(username: String, password: String, realm: String? = null, sendWithoutRequest: Boolean = false)

Client basic authentication provider.

Properties

sendWithoutRequest

val sendWithoutRequest: Boolean

Wait for HttpStatusCode.Unauthorized to send credentials.

Functions

addRequestHeaders

suspend fun addRequestHeaders(request: HttpRequestBuilder): Unit

Add authentication method headers and creds.

isApplicable

fun isApplicable(auth: HttpAuthHeader): Boolean

Check if current provider is applicable to the request.