Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 133 for token2 (0.04 sec)

  1. docs/es/docs/tutorial/security/oauth2-jwt.md

    Actualiza `get_current_user` para recibir el mismo token que antes, pero esta vez, usando tokens JWT.
    
    Decodifica el token recibido, verifícalo y devuelve el usuario actual.
    
    Si el token es inválido, devuelve un error HTTP de inmediato.
    
    {* ../../docs_src/security/tutorial004_an_py310.py hl[90:107] *}
    
    ## Actualizar la *path operation* `/token` { #update-the-token-path-operation }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 11.3K bytes
    - Viewed (0)
  2. docs/es/docs/tutorial/security/simple-oauth2.md

    ///
    
    ## Devolver el token { #return-the-token }
    
    El response del endpoint `token` debe ser un objeto JSON.
    
    Debe tener un `token_type`. En nuestro caso, como estamos usando tokens "Bearer", el tipo de token debe ser "`bearer`".
    
    Y debe tener un `access_token`, con un string que contenga nuestro token de acceso.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  3. fastapi/security/oauth2.py

        """
        OAuth2 flow for authentication using a bearer token obtained with an OAuth2 code
        flow. An instance of it would be used as a dependency.
        """
    
        def __init__(
            self,
            authorizationUrl: str,
            tokenUrl: Annotated[
                str,
                Doc(
                    """
                    The URL to obtain the OAuth2 token.
                    """
                ),
            ],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 22K bytes
    - Viewed (0)
  4. docs/es/docs/advanced/security/oauth2-scopes.md

    <img src="/img/tutorial/security/image11.png">
    
    ## Token JWT con scopes { #jwt-token-with-scopes }
    
    Ahora, modifica la *path operation* del token para devolver los scopes solicitados.
    
    Todavía estamos usando el mismo `OAuth2PasswordRequestForm`. Incluye una propiedad `scopes` con una `list` de `str`, con cada scope que recibió en el request.
    
    Y devolvemos los scopes como parte del token JWT.
    
    /// danger | Peligro
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 10:15:01 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/fess/sso/entraid/EntraIdAuthenticator.java

                throw new SsoLoginException("could not validate nonce", e);
            }
        }
    
        /**
         * Obtains an access token using a refresh token.
         * @param refreshToken The refresh token to use for token acquisition.
         * @return The authentication result containing the access token.
         */
        public IAuthenticationResult getAccessToken(final String refreshToken) {
    Registered: Sat Dec 20 09:19:18 UTC 2025
    - Last Modified: Sat Dec 13 02:21:17 UTC 2025
    - 56.7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_bigger_applications/test_main.py

        response = client.put(
            "/items/bar?token=jessica", headers={"X-Token": "fake-super-secret-token"}
        )
        assert response.status_code == 403, response.text
        assert response.json() == {"detail": "You can only update the item: plumbus"}
    
    
    def test_admin(client: TestClient):
        response = client.post(
            "/admin/?token=jessica", headers={"X-Token": "fake-super-secret-token"}
        )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 21.3K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial012.py

        response = client.get("/items/", headers={"X-Token": "invalid"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    def test_get_invalid_one_users(client: TestClient):
        response = client.get("/users/", headers={"X-Token": "invalid"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "X-Token header invalid"}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.7K bytes
    - Viewed (0)
  8. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py

    
    @app.get(
        "/with-get-token", dependencies=[Security(get_token, scopes=["read", "write"])]
    )
    async def read_with_get_token():
        return {"message": "Admin Access"}
    
    
    router = APIRouter(dependencies=[Security(oauth2_scheme, scopes=["read"])])
    
    
    @router.get("/items/")
    async def read_items(token: Optional[str] = Depends(oauth2_scheme)):
        return {"token": token}
    
    
    @router.post("/items/")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  9. docs_src/websockets/tutorial002_py39.py

            <script>
            var ws = null;
                function connect(event) {
                    var itemId = document.getElementById("itemId")
                    var token = document.getElementById("token")
                    ws = new WebSocket("ws://localhost:8000/items/" + itemId.value + "/ws?token=" + token.value);
                    ws.onmessage = function(event) {
                        var messages = document.getElementById('messages')
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  10. docs/es/docs/tutorial/security/first-steps.md

    Si no ve un header `Authorization`, o el valor no tiene un token `Bearer `, responderá directamente con un error de código de estado 401 (`UNAUTHORIZED`).
    
    Ni siquiera tienes que verificar si el token existe para devolver un error. Puedes estar seguro de que si tu función se ejecuta, tendrá un `str` en ese token.
    
    Puedes probarlo ya en los docs interactivos:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 8.9K bytes
    - Viewed (0)
Back to top