Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for unauthorized (0.22 sec)

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

      /**
       * Returns the RFC 7235 authorization challenges appropriate for this response's code. If the
       * response code is 401 unauthorized, this returns the "WWW-Authenticate" challenges. If the
       * response code is 407 proxy unauthorized, this returns the "Proxy-Authenticate" challenges.
       * Otherwise this returns an empty list of challenges.
       *
    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)
  2. okhttp/src/test/java/okhttp3/internal/authenticator/JavaNetAuthenticatorTest.kt

        val response =
          Response.Builder()
            .request(request)
            .code(401)
            .header("WWW-Authenticate", "Basic realm=\"User Visible Realm\"")
            .protocol(HTTP_2)
            .message("Unauthorized")
            .build()
        val authRequest = authenticator.authenticate(route, response)
    
        assertEquals(
          "Basic ${RecordingAuthenticator.BASE_64_CREDENTIALS}",
          authRequest!!.header("Authorization"),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/http/RetryAndFollowUpInterceptor.kt

    import java.net.HttpURLConnection.HTTP_MULT_CHOICE
    import java.net.HttpURLConnection.HTTP_PROXY_AUTH
    import java.net.HttpURLConnection.HTTP_SEE_OTHER
    import java.net.HttpURLConnection.HTTP_UNAUTHORIZED
    import java.net.HttpURLConnection.HTTP_UNAVAILABLE
    import java.net.ProtocolException
    import java.net.Proxy
    import java.net.SocketTimeoutException
    import java.security.cert.CertificateException
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12.1K bytes
    - Viewed (4)
  4. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

       */
      @Test
      fun unauthorizedResponseHandling() {
        val mockResponse =
          MockResponse(
            code = HttpURLConnection.HTTP_UNAUTHORIZED,
            headers = headersOf("WWW-Authenticate", "challenge"),
            body = "Unauthorized",
          )
        server.enqueue(mockResponse)
        server.enqueue(mockResponse)
        server.enqueue(mockResponse)
        val response = getResponse(newRequest("/"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/DuplexTest.kt

            .requestIOException()
            .exhaustResponse()
        server.enqueue(
          MockResponse.Builder()
            .clearHeaders()
            .code(HttpURLConnection.HTTP_UNAUTHORIZED)
            .streamHandler(body1)
            .build(),
        )
        val body =
          MockStreamHandler()
            .sendResponse("response body\n")
            .exhaustResponse()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

      fun authenticate(
        protocol: Protocol,
        mockWebServer: MockWebServer,
      ) {
        setUp(protocol, mockWebServer)
        server.enqueue(
          MockResponse(
            code = HttpURLConnection.HTTP_UNAUTHORIZED,
            headers = headersOf("www-authenticate", "Basic realm=\"protected area\""),
            body = "Please authenticate.",
          ),
        )
        server.enqueue(
          MockResponse(body = "Successful auth!"),
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/CacheTest.kt

        when (responseCode) {
          HttpURLConnection.HTTP_PROXY_AUTH -> {
            builder.addHeader("Proxy-Authenticate: Basic realm=\"protected area\"")
          }
    
          HttpURLConnection.HTTP_UNAUTHORIZED -> {
            builder.addHeader("WWW-Authenticate: Basic realm=\"protected area\"")
          }
    
          HttpURLConnection.HTTP_NO_CONTENT, HttpURLConnection.HTTP_RESET -> {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
  8. LICENSE.txt

          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jul 23 14:02:28 GMT 2012
    - 11.1K bytes
    - Viewed (0)
  9. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerCertificatesTest.kt

                      ),
                    ),
                    listOf(
                      AttributeTypeAndValue(
                        type = ORGANIZATIONAL_UNIT_NAME,
                        value = "(c) 2009 Entrust, Inc. - for authorized use only",
                      ),
                    ),
                    listOf(
                      AttributeTypeAndValue(
                        type = COMMON_NAME,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 43.9K bytes
    - Viewed (0)
  10. docs/recipes.md

            }
          }
        ```
    
    ### Handling authentication ([.kt][AuthenticateKotlin], [.java][AuthenticateJava])
    
    OkHttp can automatically retry unauthenticated requests. When a response is `401 Not Authorized`, an `Authenticator` is asked to supply credentials. Implementations should build a new request that includes the missing credentials. If no credentials are available, return null to skip the retry.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
Back to top