Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for challenges (0.17 sec)

  1. 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)
  2. samples/guide/src/main/java/okhttp3/recipes/Authenticate.java

                return null; // Give up, we've already attempted to authenticate.
              }
    
              System.out.println("Authenticating for response: " + response);
              System.out.println("Challenges: " + response.challenges());
              String credential = Credentials.basic("jesse", "password1");
              return response.request().newBuilder()
                  .header("Authorization", credential)
                  .build();
            })
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 1.9K bytes
    - Viewed (0)
  3. 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)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/Authenticate.kt

                  return null // Give up, we've already attempted to authenticate.
                }
    
                println("Authenticating for response: $response")
                println("Challenges: ${response.challenges()}")
                val credential = Credentials.basic("jesse", "password1")
                return response.request.newBuilder()
                  .header("Authorization", credential)
                  .build()
              }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  5. okhttp-testing-support/src/main/kotlin/okhttp3/internal/RecordingOkAuthenticator.kt

        return response.request.newBuilder()
          .addHeader(header, credential)
          .build()
      }
    
      private fun schemeMatches(response: Response): Boolean {
        if (scheme == null) return true
        return response.challenges().any { it.scheme.equals(scheme, ignoreCase = true) }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/Connection.kt

     * connection is typically faster than establishing a new one.
     *
     * When a single logical call requires multiple streams due to redirects or authorization
     * challenges, we prefer to use the same physical connection for all streams in the sequence. There
     * are potential performance and behavior consequences to this preference. To support this feature,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  7. docs/features/connections.md

     4. If it's a new route, it connects by building either a direct socket connection, a TLS tunnel (for HTTPS over an HTTP proxy), or a direct TLS connection. It does TLS handshakes as necessary. This step may be retried for tunnel challenges and TLS handshake failures.
     5. It sends the HTTP request and reads the response.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Feb 21 03:33:59 GMT 2022
    - 5.4K bytes
    - Viewed (0)
  8. 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)
  9. docs/features/events.md

    A single HTTP call may require follow-up requests to be made to handle authentication challenges, redirects, and HTTP-layer timeouts. In such cases multiple connections, requests, and responses may be attempted. Follow-ups are another reason a single call may trigger multiple events of the same type.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  10. 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)
Back to top