Auth

    This feature is defined in the class in the artifact io.ktor:ktor-client-auth:$ktor_version.

    1. dependencies {
    2. implementation("io.ktor:ktor-client-auth:$ktor_version")
    3. }
    1. <project>
    2. ...
    3. <dependencies>
    4. <dependency>
    5. <groupId>io.ktor</groupId>
    6. <artifactId>ktor-client-auth</artifactId>
    7. <version>${ktor.version}</version>
    8. <scope>compile</scope>
    9. </dependency>
    10. </dependencies>
    11. </project>
    1. dependencies {
    2. implementation "io.ktor:ktor-client-auth-jvm:$ktor_version"
    1. dependencies {
    2. implementation("io.ktor:ktor-client-auth-jvm:$ktor_version")
    3. }
    1. dependencies {
    2. implementation "io.ktor:ktor-client-auth-native:$ktor_version"
    3. }
    1. dependencies {
    2. }
    1. <project>
    2. ...
    3. <dependencies>
    4. <dependency>
    5. <groupId>io.ktor</groupId>
    6. <artifactId>ktor-client-auth-native</artifactId>
    7. <version>${ktor.version}</version>
    8. <scope>compile</scope>
    9. </dependency>
    10. </dependencies>
    11. </project>
    1. dependencies {
    2. implementation "io.ktor:ktor-client-auth-js:$ktor_version"
    3. }
    1. <project>
    2. ...
    3. <dependencies>
    4. <dependency>
    5. <groupId>io.ktor</groupId>
    6. <version>${ktor.version}</version>
    7. <scope>compile</scope>
    8. </dependency>
    9. </dependencies>
    1. val client = HttpClient() {
    2. install(Auth) {
    3. // providers config
    4. ...
    5. }
    6. }

    Providers

    1. val client = HttpClient() {
    2. install(Auth) {
    3. basic {
    4. username = "username"
    5. password = "password"
    6. }
    7. }
    8. }

    This feature implements the IETF’s .

    Digest

    1. val client = HttpClient() {
    2. install(Auth) {
    3. digest {
    4. username = "username"
    5. password = "password"
    6. realm = "custom"
    7. }
    8. }
    9. }

    This feature implements the IETF’s .