Auth
This feature is defined in the class in the artifact io.ktor:ktor-client-auth:$ktor_version
.
dependencies {
implementation("io.ktor:ktor-client-auth:$ktor_version")
}
<project>
...
<dependencies>
<dependency>
<groupId>io.ktor</groupId>
<artifactId>ktor-client-auth</artifactId>
<version>${ktor.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
dependencies {
implementation "io.ktor:ktor-client-auth-jvm:$ktor_version"
dependencies {
implementation("io.ktor:ktor-client-auth-jvm:$ktor_version")
}
dependencies {
implementation "io.ktor:ktor-client-auth-native:$ktor_version"
}
dependencies {
}
<project>
...
<dependencies>
<dependency>
<groupId>io.ktor</groupId>
<artifactId>ktor-client-auth-native</artifactId>
<version>${ktor.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
dependencies {
implementation "io.ktor:ktor-client-auth-js:$ktor_version"
}
<project>
...
<dependencies>
<dependency>
<groupId>io.ktor</groupId>
<version>${ktor.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
val client = HttpClient() {
install(Auth) {
// providers config
...
}
}
Providers
val client = HttpClient() {
install(Auth) {
basic {
username = "username"
password = "password"
}
}
}
This feature implements the IETF’s .
Digest
val client = HttpClient() {
install(Auth) {
digest {
username = "username"
password = "password"
realm = "custom"
}
}
}
This feature implements the IETF’s .