Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for tokenUrl (0.77 sec)

  1. docs/ru/docs/tutorial/security/first-steps.md

    ///
    
    При создании экземпляра класса `OAuth2PasswordBearer` мы передаем параметр `tokenUrl`. Этот параметр содержит URL, который клиент (фронтенд, работающий в браузере пользователя) будет использовать для отправки `username` и `password`, чтобы получить токен.
    
    {* ../../docs_src/security/tutorial001_an_py39.py hl[8] *}
    
    /// tip | Подсказка
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  2. docs_src/security/tutorial002_py39.py

    from typing import 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):
        return User(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 755 bytes
    - Viewed (0)
  3. fastapi/security/oauth2.py

            ] = None,
        ):
            if not scopes:
                scopes = {}
            flows = OAuthFlowsModel(
                password=cast(
                    Any,
                    {
                        "tokenUrl": tokenUrl,
                        "refreshUrl": refreshUrl,
                        "scopes": scopes,
                    },
                )
            )
            super().__init__(
                flows=flows,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 22K bytes
    - Viewed (0)
  4. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py

    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="api/oauth/authorize",
        tokenUrl="/api/oauth/token",
        scopes={"read": "Read access", "write": "Write access"},
    )
    
    
    async def get_token(token: Annotated[str, Depends(oauth2_scheme)]) -> str:
        return token
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  5. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py

    from fastapi.security import OAuth2AuthorizationCodeBearer
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    oauth2_scheme = OAuth2AuthorizationCodeBearer(
        authorizationUrl="authorize",
        tokenUrl="token",
        auto_error=True,
        scopes={"read": "Read access", "write": "Write access"},
    )
    
    
    async def get_token(token: Annotated[str, Depends(oauth2_scheme)]) -> str:
        return token
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  6. docs/pt/docs/tutorial/security/first-steps.md

    ///
    
    Quando criamos uma instância da classe `OAuth2PasswordBearer`, passamos o parâmetro `tokenUrl`. Esse parâmetro contém a URL que o client (o frontend rodando no navegador do usuário) usará para enviar o `username` e o `password` para obter um token.
    
    {* ../../docs_src/security/tutorial001_an_py39.py hl[8] *}
    
    /// tip | Dica
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  7. docs/es/docs/tutorial/security/first-steps.md

    ///
    
    Cuando creamos una instance de la clase `OAuth2PasswordBearer` pasamos el parámetro `tokenUrl`. Este parámetro contiene la URL que el cliente (el frontend corriendo en el navegador del usuario) usará para enviar el `username` y `password` a fin de obtener un token.
    
    {* ../../docs_src/security/tutorial001_an_py39.py hl[8] *}
    
    /// tip | Consejo
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  8. 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)
  9. tests/test_security_oauth2_optional.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        },
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial001.py

                }
            },
            "components": {
                "securitySchemes": {
                    "OAuth2PasswordBearer": {
                        "type": "oauth2",
                        "flows": {"password": {"scopes": {}, "tokenUrl": "token"}},
                    }
                }
            },
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.2K bytes
    - Viewed (0)
Back to top