Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 44 for OAuth2PasswordBearer (0.07 sec)

  1. tests/test_tutorial/test_security/test_tutorial002.py

                        "operationId": "read_users_me_users_me_get",
                        "security": [{"OAuth2PasswordBearer": []}],
                    }
                }
            },
            "components": {
                "securitySchemes": {
                    "OAuth2PasswordBearer": {
                        "type": "oauth2",
                        "flows": {"password": {"scopes": {}, "tokenUrl": "token"}},
                    }
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_security/test_tutorial005.py

                                }
                            },
                            "summary": "Read Users Me",
                            "operationId": "read_users_me_users_me__get",
                            "security": [{"OAuth2PasswordBearer": ["me"]}],
                        }
                    },
                    "/users/me/items/": {
                        "get": {
                            "responses": {
                                "200": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  3. docs_src/security/tutorial001_py39.py

    from fastapi import Depends, FastAPI
    from fastapi.security import OAuth2PasswordBearer
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    @app.get("/items/")
    async def read_items(token: str = Depends(oauth2_scheme)):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 269 bytes
    - Viewed (0)
  4. docs_src/security/tutorial003_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from pydantic import BaseModel
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
        },
        "alice": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  5. fastapi/security/__init__.py

    from .http import HTTPDigest as HTTPDigest
    from .oauth2 import OAuth2 as OAuth2
    from .oauth2 import OAuth2AuthorizationCodeBearer as OAuth2AuthorizationCodeBearer
    from .oauth2 import OAuth2PasswordBearer as OAuth2PasswordBearer
    from .oauth2 import OAuth2PasswordRequestForm as OAuth2PasswordRequestForm
    from .oauth2 import OAuth2PasswordRequestFormStrict as OAuth2PasswordRequestFormStrict
    from .oauth2 import SecurityScopes as SecurityScopes
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Dec 20 18:50:00 UTC 2020
    - 881 bytes
    - Viewed (0)
  6. docs_src/security/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Depends, FastAPI
    from fastapi.security import OAuth2PasswordBearer
    from pydantic import BaseModel
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    def fake_decode_token(token):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 786 bytes
    - Viewed (0)
  7. docs_src/security/tutorial004_an_py39.py

    from datetime import datetime, timedelta, timezone
    from typing import Annotated, Union
    
    import jwt
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from jwt.exceptions import InvalidTokenError
    from pwdlib import PasswordHash
    from pydantic import BaseModel
    
    # to get a string like this run:
    # openssl rand -hex 32
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 02:57:38 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  8. tests/test_dependency_paramless.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, HTTPException, Security
    from fastapi.security import (
        OAuth2PasswordBearer,
        SecurityScopes,
    )
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    def process_auth(
        credentials: Annotated[Union[str, None], Security(oauth2_scheme)],
        security_scopes: SecurityScopes,
    ):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/security/first-steps.md

    ## **FastAPI**'s `OAuth2PasswordBearer` { #fastapis-oauth2passwordbearer }
    
    **FastAPI** provides several tools, at different levels of abstraction, to implement these security features.
    
    In this example we are going to use **OAuth2**, with the **Password** flow, using a **Bearer** token. We do that using the `OAuth2PasswordBearer` class.
    
    /// info
    
    A "bearer" token is not the only option.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  10. docs/ru/docs/tutorial/security/first-steps.md

    ## Класс `OAuth2PasswordBearer` в **FastAPI** { #fastapis-oauth2passwordbearer }
    
    **FastAPI** предоставляет несколько средств на разных уровнях абстракции для реализации этих функций безопасности.
    
    В этом примере мы будем использовать **OAuth2**, с потоком **Password**, используя токен **Bearer**. Для этого мы используем класс `OAuth2PasswordBearer`.
    
    /// info | Дополнительная информация
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 14.2K bytes
    - Viewed (0)
Back to top