Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 270 for Basic (0.19 sec)

  1. docs/zh/docs/advanced/security/http-basic-auth.md

    # HTTP 基础授权
    
    最简单的用例是使用 HTTP 基础授权(HTTP Basic Auth)。
    
    在 HTTP 基础授权中,应用需要请求头包含用户名与密码。
    
    如果没有接收到 HTTP 基础授权,就返回 HTTP 401 `"Unauthorized"` 错误。
    
    并返回含 `Basic` 值的请求头 `WWW-Authenticate`以及可选的 `realm` 参数。
    
    HTTP 基础授权让浏览器显示内置的用户名与密码提示。
    
    输入用户名与密码后,浏览器会把它们自动发送至请求头。
    
    ## 简单的 HTTP 基础授权
    
    * 导入 `HTTPBsic` 与 `HTTPBasicCredentials`
    * 使用 `HTTPBsic` 创建**安全概图**
    * 在*路径操作*的依赖项中使用 `security`
    * 返回类型为 `HTTPBasicCredentials` 的对象:
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 22:43:48 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/security/http-basic-auth.md

    # HTTP Basic Auth
    
    Für die einfachsten Fälle können Sie <abbr title="HTTP-Basisauthentifizierung">HTTP Basic Auth</abbr> verwenden.
    
    Bei HTTP Basic Auth erwartet die Anwendung einen Header, der einen Benutzernamen und ein Passwort enthält.
    
    Wenn sie diesen nicht empfängt, gibt sie den HTTP-Error 401 „Unauthorized“ zurück.
    
    Und gibt einen Header `WWW-Authenticate` mit dem Wert `Basic` und einem optionalen `realm`-Parameter („Bereich“) zurück.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:28:08 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/security/http-basic-auth.md

    # HTTP Basic Auth
    
    For the simplest cases, you can use HTTP Basic Auth.
    
    In HTTP Basic Auth, the application expects a header that contains a username and a password.
    
    If it doesn't receive it, it returns an HTTP 401 "Unauthorized" error.
    
    And returns a header `WWW-Authenticate` with a value of `Basic`, and an optional `realm` parameter.
    
    That tells the browser to show the integrated prompt for a username and password.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 14:33:05 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  4. tests/test_security_http_basic_realm.py

        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    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)
  5. tests/test_security_http_basic_optional.py

    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == "Basic"
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    
    def test_security_http_basic_non_basic_credentials():
    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)
  6. tests/test_security_http_basic_realm_description.py

        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/HeadersChallengesTest.kt

            .add("WWW-Authenticate", "Basic realm=myotherrealm")
            .build()
        assertThat(headers.parseChallenges("WWW-Authenticate")).containsExactly(
          Challenge("Basic", mapOf("realm" to "myrealm")),
          Challenge("Basic", mapOf("realm" to "myotherrealm")),
        )
      }
    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)
  8. tests/test_tutorial/test_security/test_tutorial006_an.py

        assert response.headers["WWW-Authenticate"] == "Basic"
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == "Basic"
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    
    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)
  9. fastapi/security/http.py

    class HTTPBasicCredentials(BaseModel):
        """
        The HTTP Basic credentials given as the result of using `HTTPBasic` in a
        dependency.
    
        Read more about it in the
        [FastAPI docs for HTTP Basic Auth](https://fastapi.tiangolo.com/advanced/security/http-basic-auth/).
        """
    
        username: Annotated[str, Doc("The HTTP Basic username.")]
        password: Annotated[str, Doc("The HTTP Basic password.")]
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial006.py

        assert response.headers["WWW-Authenticate"] == "Basic"
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == "Basic"
        assert response.json() == {"detail": "Invalid authentication credentials"}
    
    
    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)
Back to top