Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 41 for tokentype (0.07 sec)

  1. docs_src/security/tutorial003_py310.py

        if not hashed_password == user.hashed_password:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
    
        return {"access_token": user.username, "token_type": "bearer"}
    
    
    @app.get("/users/me")
    async def read_users_me(current_user: User = Depends(get_current_active_user)):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  2. docs_src/security/tutorial003.py

        if not hashed_password == user.hashed_password:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
    
        return {"access_token": user.username, "token_type": "bearer"}
    
    
    @app.get("/users/me")
    async def read_users_me(current_user: User = Depends(get_current_active_user)):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  3. docs_src/security/tutorial003_an_py310.py

        if not hashed_password == user.hashed_password:
            raise HTTPException(status_code=400, detail="Incorrect username or password")
    
        return {"access_token": user.username, "token_type": "bearer"}
    
    
    @app.get("/users/me")
    async def read_users_me(
        current_user: Annotated[User, Depends(get_current_active_user)],
    ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/security/simple-oauth2.md

    )
    ```
    
    /// info
    
    ๐ŸŒ… ๐Ÿ ๐Ÿ”‘ `**๐Ÿ‘ฉโ€๐Ÿ’ป_ #๏ธโƒฃ ` โœ… ๐Ÿ”™ [๐Ÿงพ **โž• ๐Ÿท**](../extra-models.md#user_indict){.internal-link target=_blank}.
    
    ///
    
    ## ๐Ÿ“จ ๐Ÿค
    
    ๐Ÿ“จ `token` ๐Ÿ”— ๐Ÿ”œ ๐ŸŽป ๐ŸŽš.
    
    โšซ๏ธ ๐Ÿ”œ โœ”๏ธ `token_type`. ๐Ÿ‘† ๐Ÿ’ผ, ๐Ÿ‘ฅ โš™๏ธ "๐Ÿ“จ" ๐Ÿค, ๐Ÿค ๐Ÿ†Ž ๐Ÿ”œ "`bearer`".
    
    & โšซ๏ธ ๐Ÿ”œ โœ”๏ธ `access_token`, โฎ๏ธ ๐ŸŽป โš— ๐Ÿ‘† ๐Ÿ” ๐Ÿค.
    
    ๐Ÿ‘‰ ๐Ÿ™… ๐Ÿ–ผ, ๐Ÿ‘ฅ ๐Ÿ”œ ๐Ÿ• ๐Ÿ˜Ÿ & ๐Ÿ“จ ๐ŸŽ `username` ๐Ÿค.
    
    /// tip
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial003.py

    
    def test_login():
        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        assert response.json() == {"access_token": "johndoe", "token_type": "bearer"}
    
    
    def test_login_incorrect_password():
        response = client.post(
            "/token", data={"username": "johndoe", "password": "incorrect"}
        )
        assert response.status_code == 400, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial003_an_py310.py

        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        assert response.json() == {"access_token": "johndoe", "token_type": "bearer"}
    
    
    @needs_py310
    def test_login_incorrect_password(client: TestClient):
        response = client.post(
            "/token", data={"username": "johndoe", "password": "incorrect"}
        )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial003_py310.py

        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        assert response.json() == {"access_token": "johndoe", "token_type": "bearer"}
    
    
    @needs_py310
    def test_login_incorrect_password(client: TestClient):
        response = client.post(
            "/token", data={"username": "johndoe", "password": "incorrect"}
        )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial003_an_py39.py

        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        assert response.json() == {"access_token": "johndoe", "token_type": "bearer"}
    
    
    @needs_py39
    def test_login_incorrect_password(client: TestClient):
        response = client.post(
            "/token", data={"username": "johndoe", "password": "incorrect"}
        )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/security/simple-oauth2.md

    ///
    
    ## Return the token
    
    The response of the `token` endpoint must be a JSON object.
    
    It should have a `token_type`. In our case, as we are using "Bearer" tokens, the token type should be "`bearer`".
    
    And it should have an `access_token`, with a string containing our access token.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  10. docs/de/docs/tutorial/security/simple-oauth2.md

    ///
    
    ## Den Token zurรผckgeben
    
    Die Response des `token`-Endpunkts muss ein JSON-Objekt sein.
    
    Es sollte einen `token_type` haben. Da wir in unserem Fall โ€žBearerโ€œ-Token verwenden, sollte der Token-Typ "`bearer`" sein.
    
    Und es sollte einen `access_token` haben, mit einem String, der unseren Zugriffstoken enthรคlt.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 14.1K bytes
    - Viewed (0)
Back to top