Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 253 for authenticate (0.19 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/kt/Authenticate.kt

    import java.io.IOException
    import okhttp3.Authenticator
    import okhttp3.Credentials
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.Route
    
    class Authenticate {
      private val client =
        OkHttpClient.Builder()
          .authenticator(
            object : Authenticator {
              @Throws(IOException::class)
              override fun authenticate(
                route: Route?,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. samples/guide/src/main/java/okhttp3/recipes/Authenticate.java

    import okhttp3.Request;
    import okhttp3.Response;
    
    public final class Authenticate {
      private final OkHttpClient client;
    
      public Authenticate() {
        client = new OkHttpClient.Builder()
            .authenticator((route, response) -> {
              if (response.request().header("Authorization") != null) {
                return null; // Give up, we've already attempted to authenticate.
              }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 1.9K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Authenticator.kt

       */
      @Throws(IOException::class)
      fun authenticate(
        route: Route?,
        response: Response,
      ): Request?
    
      companion object {
        /** An authenticator that knows no credentials and makes no attempt to authenticate. */
        @JvmField
        val NONE: Authenticator = AuthenticatorNone()
    
        private class AuthenticatorNone : Authenticator {
          override fun authenticate(
            route: Route?,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/HeadersChallengesTest.kt

            .add("WWW-Authenticate", "Basic realm=myrealm")
            .add("WWW-Authenticate", "Digest")
            .build()
        assertThat(headers.parseChallenges("WWW-Authenticate")).containsExactly(
          Challenge("Basic", mapOf("realm" to "myrealm")),
          Challenge("Digest", mapOf()),
        )
      }
    
      @Test fun multipleBasicAuthenticateHeaders() {
        val headers =
          Headers.Builder()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 16.6K bytes
    - Viewed (0)
  5. src/main/java/jcifs/http/NtlmServlet.java

                }
                catch ( SmbAuthException sae ) {
                    response.setHeader("WWW-Authenticate", "NTLM");
                    if ( offerBasic ) {
                        response.addHeader("WWW-Authenticate", "Basic realm=\"" + this.realm + "\"");
                    }
                    response.setHeader("Connection", "close");
    Java
    - Registered: Sun Apr 28 00:10:09 GMT 2024
    - Last Modified: Sun Jul 01 13:12:10 GMT 2018
    - 7.6K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial006.py

    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
        assert response.json() == {"detail": "Not authenticated"}
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == "Basic"
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  7. tests/test_security_http_basic_realm.py

    
    def test_security_http_basic_no_credentials():
        response = client.get("/users/me")
        assert response.json() == {"detail": "Not authenticated"}
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

    
    @needs_py39
    def test_no_token(client: TestClient):
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py39
    def test_token(client: TestClient):
        access_token = get_access_token(scope="me", client=client)
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_security/test_tutorial005_py310.py

    
    @needs_py310
    def test_no_token(client: TestClient):
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py310
    def test_token(client: TestClient):
        access_token = get_access_token(scope="me", client=client)
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  10. okhttp-urlconnection/src/main/kotlin/okhttp3/JavaNetAuthenticator.kt

     */
    package okhttp3
    
    import java.io.IOException
    import okhttp3.Authenticator.Companion.JAVA_NET_AUTHENTICATOR
    
    /**
     * Do not use this.
     *
     * Instead, configure your OkHttpClient.Builder to use `Authenticator.JAVA_NET_AUTHENTICATOR`:
     *
     * ```
     *   val okHttpClient = OkHttpClient.Builder()
     *     .authenticator(okhttp3.Authenticator.Companion.JAVA_NET_AUTHENTICATOR)
     *     .build()
     * ```
     */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
Back to top