- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 110 for Authenticate (0.2 sec)
-
samples/guide/src/main/java/okhttp3/recipes/kt/Authenticate.kt
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?, response: Response, ): Request? {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.9K bytes - Viewed (0) -
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. }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Aug 12 07:26:27 UTC 2021 - 1.9K bytes - Viewed (0) -
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?,
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 5.5K bytes - Viewed (0) -
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"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.3K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial006_an_py39.py
@needs_py39 def test_security_http_basic_no_credentials(client: TestClient): response = client.get("/users/me") assert response.json() == {"detail": "Not authenticated"} assert response.status_code == 401, response.text assert response.headers["WWW-Authenticate"] == "Basic" @needs_py39 def test_security_http_basic_invalid_credentials(client: TestClient): response = client.get(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.5K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial006_an.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"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.3K bytes - Viewed (0) -
tests/test_security_http_basic_realm_description.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(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.8K bytes - Viewed (0) -
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(
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.6K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/authenticator/JavaNetAuthenticatorTest.kt
.build() 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}",
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 2.7K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial001.py
client = TestClient(app) def test_no_token(): response = client.get("/items") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(): response = client.get("/items", headers={"Authorization": "Bearer testtoken"}) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.9K bytes - Viewed (0)