Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 19 of 19 for HTTPBasic (0.21 sec)

  1. tests/test_security_http_basic_realm.py

    from base64 import b64encode
    
    from fastapi import FastAPI, Security
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBasic(realm="simple")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPBasicCredentials = Security(security)):
        return {"username": credentials.username, "password": credentials.password}
    
    
    client = TestClient(app)
    
    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)
  2. docs_src/security/tutorial007_an.py

    import secrets
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    security = HTTPBasic()
    
    
    def get_current_username(
        credentials: Annotated[HTTPBasicCredentials, Depends(security)],
    ):
        current_username_bytes = credentials.username.encode("utf8")
        correct_username_bytes = b"stanleyjobson"
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_security/test_tutorial006_an.py

                        "summary": "Read Current User",
                        "operationId": "read_current_user_users_me_get",
                        "security": [{"HTTPBasic": []}],
                    }
                }
            },
            "components": {
                "securitySchemes": {"HTTPBasic": {"type": "http", "scheme": "basic"}}
            },
    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)
  4. fastapi/security/http.py

        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import Depends, FastAPI
        from fastapi.security import HTTPBasic, HTTPBasicCredentials
    
        app = FastAPI()
    
        security = HTTPBasic()
    
    
        @app.get("/users/me")
        def read_current_user(credentials: Annotated[HTTPBasicCredentials, Depends(security)]):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  5. docs/de/docs/reference/security/index.md

    Sie kรถnnen sie von `fastapi.security` importieren:
    
    ```python
    from fastapi.security import (
        APIKeyCookie,
        APIKeyHeader,
        APIKeyQuery,
        HTTPAuthorizationCredentials,
        HTTPBasic,
        HTTPBasicCredentials,
        HTTPBearer,
        HTTPDigest,
        OAuth2,
        OAuth2AuthorizationCodeBearer,
        OAuth2PasswordBearer,
        OAuth2PasswordRequestForm,
        OAuth2PasswordRequestFormStrict,
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:15:05 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial006.py

                        "summary": "Read Current User",
                        "operationId": "read_current_user_users_me_get",
                        "security": [{"HTTPBasic": []}],
                    }
                }
            },
            "components": {
                "securitySchemes": {"HTTPBasic": {"type": "http", "scheme": "basic"}}
            },
    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. docs/em/docs/advanced/security/http-basic-auth.md

    & ๐Ÿ“จ ๐ŸŽš `WWW-Authenticate` โฎ๏ธ ๐Ÿ’ฒ `Basic`, & ๐Ÿ“ฆ `realm` ๐Ÿ”ข.
    
    ๐Ÿ‘ˆ ๐Ÿ’ฌ ๐Ÿ–ฅ ๐ŸŽฆ ๐Ÿ› ๏ธ ๐Ÿ“‹ ๐Ÿ†” & ๐Ÿ”.
    
    โคด๏ธ, ๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ†Ž ๐Ÿ‘ˆ ๐Ÿ†” & ๐Ÿ”, ๐Ÿ–ฅ ๐Ÿ“จ ๐Ÿ‘ซ ๐ŸŽš ๐Ÿ”.
    
    ## ๐Ÿ™… ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” ๐Ÿ”ฐ ๐Ÿ”
    
    * ๐Ÿ—„ `HTTPBasic` & `HTTPBasicCredentials`.
    * โœ "`security` โš–" โš™๏ธ `HTTPBasic`.
    * โš™๏ธ ๐Ÿ‘ˆ `security` โฎ๏ธ ๐Ÿ”— ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ*.
    * โšซ๏ธ ๐Ÿ“จ ๐ŸŽš ๐Ÿ†Ž `HTTPBasicCredentials`:
        * โšซ๏ธ ๐Ÿ”Œ `username` & `password` ๐Ÿ“จ.
    
    ```Python hl_lines="2  6  10"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/security/http-basic-auth.md

    Then, when you type that username and password, the browser sends them in the header automatically.
    
    ## Simple HTTP Basic Auth
    
    * Import `HTTPBasic` and `HTTPBasicCredentials`.
    * Create a "`security` scheme" using `HTTPBasic`.
    * Use that `security` with a dependency in your *path operation*.
    * It returns an object of type `HTTPBasicCredentials`:
        * It contains the `username` and `password` sent.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 14:33:05 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  9. docs/de/docs/advanced/security/http-basic-auth.md

    Wenn Sie dann den Benutzernamen und das Passwort eingeben, sendet der Browser diese automatisch im Header.
    
    ## Einfaches HTTP Basic Auth
    
    * Importieren Sie `HTTPBasic` und `HTTPBasicCredentials`.
    * Erstellen Sie mit `HTTPBasic` ein โ€ž`security`-Schemaโ€œ.
    * Verwenden Sie dieses `security` mit einer Abhรคngigkeit in Ihrer *Pfadoperation*.
    * Diese gibt ein Objekt vom Typ `HTTPBasicCredentials` zurรผck:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:28:08 GMT 2024
    - 6.9K bytes
    - Viewed (0)
Back to top