Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for Challenge (4.37 sec)

  1. okhttp/src/main/kotlin/okhttp3/Challenge.kt

    import okhttp3.internal.commonEquals
    import okhttp3.internal.commonHashCode
    import okhttp3.internal.commonToString
    
    /**
     * An [RFC 7235][rfc_7235] challenge.
     *
     * [rfc_7235]: https://tools.ietf.org/html/rfc7235
     */
    class Challenge(
      /** Returns the authentication scheme, like `Basic`. */
      @get:JvmName("scheme") val scheme: String,
      authParams: Map<String?, String>,
    ) {
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/authenticator/JavaNetAuthenticator.kt

        route: Route?,
        response: Response,
      ): Request? {
        val challenges = response.challenges()
        val request = response.request
        val url = request.url
        val proxyAuthorization = response.code == 407
        val proxy = route?.proxy ?: Proxy.NO_PROXY
    
        for (challenge in challenges) {
          if (!"Basic".equals(challenge.scheme, ignoreCase = true)) {
            continue
          }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/HeadersChallengesTest.kt

      }
    
      @Test fun testDigestChallengeWithTokenFormOfAuthParam() {
        val headers =
          Headers.Builder()
            .add("WWW-Authenticate", "Digest realm=myrealm").build()
        val challenges = headers.parseChallenges("WWW-Authenticate")
        assertThat(challenges.size).isEqualTo(1)
        assertThat(challenges[0].scheme).isEqualTo("Digest")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.6K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt

      }
    
      @Test @Disabled
      fun challenge() {
        val challenge = Challenge("", mapOf("" to ""))
        val scheme: String = challenge.scheme()
        val authParams: Map<String?, String> = challenge.authParams()
        val realm: String? = challenge.realm()
        val charset: Charset = challenge.charset()
      }
    
      @Test @Disabled
      fun cipherSuite() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.3K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/http/HttpHeaders.kt

     */
    fun Headers.parseChallenges(headerName: String): List<Challenge> {
      val result = mutableListOf<Challenge>()
      for (h in 0 until size) {
        if (headerName.equals(name(h), ignoreCase = true)) {
          val header = Buffer().writeUtf8(value(h))
          try {
            header.readChallengeHeader(result)
          } catch (e: EOFException) {
            Platform.get().log("Unable to parse challenge", Platform.WARN, e)
          }
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/Authenticator.kt

     * challenge. The proxy authenticator may return either an authenticated request, or null to
     * connect without authentication.
     *
     * ```java
     * for (Challenge challenge : response.challenges()) {
     *   // If this is preemptive auth, use a preemptive credential.
     *   if (challenge.scheme().equalsIgnoreCase("OkHttp-Preemptive")) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/-ChallengeCommon.kt

    package okhttp3.internal
    
    import okhttp3.Challenge
    
    fun Challenge.commonEquals(other: Any?): Boolean {
      return other is Challenge &&
        other.scheme == scheme &&
        other.authParams == authParams
    }
    
    fun Challenge.commonHashCode(): Int {
      var result = 29
      result = 31 * result + scheme.hashCode()
      result = 31 * result + authParams.hashCode()
      return result
    }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

      }
    
      @Test
      fun challenge() {
        var challenge = Challenge("", mapOf("" to ""))
        challenge = Challenge("", "")
        val scheme: String = challenge.scheme
        val authParams: Map<String?, String> = challenge.authParams
        val realm: String? = challenge.realm
        val charset: Charset = challenge.charset
        val utf8: Challenge = challenge.withCharset(Charsets.UTF_8)
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  9. docs/features/calls.md

    If the response issues an authorization challenge, OkHttp will ask the [`Authenticator`](https://square.github.io/okhttp/4.x/okhttp/okhttp3/-authenticator/) (if one is configured) to satisfy the challenge. If the authenticator supplies a credential, the request is retried with that credential included.
    
    ## Retrying Requests
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 3.9K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/Response.kt

       * auth param in the challenge at key null. Invalid headers and challenges are ignored.
       * No semantic validation is done, for example that `Basic` auth must have a `realm`
       * auth param, this is up to the caller that interprets these challenges.
       */
      fun challenges(): List<Challenge> {
        return headers.parseChallenges(
          when (code) {
            HTTP_UNAUTHORIZED -> "WWW-Authenticate"
            HTTP_PROXY_AUTH -> "Proxy-Authenticate"
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 15.5K bytes
    - Viewed (0)
Back to top