- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 42 for tokenUrl (0.07 sec)
-
tests/test_security_oauth2_authorization_code_bearer_description.py
from fastapi.security import OAuth2AuthorizationCodeBearer from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2AuthorizationCodeBearer( authorizationUrl="authorize", tokenUrl="token", description="OAuth2 Code Bearer", auto_error=True, ) @app.get("/items/") async def read_items(token: Optional[str] = Security(oauth2_scheme)): return {"token": token}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.4K bytes - Viewed (0) -
tests/test_security_oauth2_password_bearer_optional.py
from typing import Optional from fastapi import FastAPI, Security from fastapi.security import OAuth2PasswordBearer from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token", auto_error=False) @app.get("/items/") async def read_items(token: Optional[str] = Security(oauth2_scheme)): if token is None: return {"msg": "Create an account first"} return {"token": token}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.1K bytes - Viewed (0) -
tests/test_security_oauth2_authorization_code_bearer.py
from fastapi.security import OAuth2AuthorizationCodeBearer from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2AuthorizationCodeBearer( authorizationUrl="authorize", tokenUrl="token", auto_error=True ) @app.get("/items/") async def read_items(token: Optional[str] = Security(oauth2_scheme)): return {"token": token} client = TestClient(app) def test_no_token():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.3K bytes - Viewed (0) -
docs/em/docs/tutorial/security/first-steps.md
๐ ๐ผ, **FastAPI** ๐ ๐ โฎ๏ธ ๐งฐ ๐ โซ๏ธ. /// ๐โ ๐ฅ โ ๐ `OAuth2PasswordBearer` ๐ ๐ฅ ๐ถโโ๏ธ `tokenUrl` ๐ข. ๐ ๐ข ๐ ๐ ๐ ๐ฉโ๐ป (๐ธ ๐ ๐ฉโ๐ป ๐ฅ) ๐ โ๏ธ ๐จ `username` & `password` โ ๐ค ๐ค. ```Python hl_lines="6" {!../../docs_src/security/tutorial001.py!} ``` /// tip ๐ฅ `tokenUrl="token"` ๐ โ ๐ `token` ๐ ๐ฅ ๐ซ โ. โซ๏ธ โ ๐, โซ๏ธ ๐ `./token`.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.8K bytes - Viewed (0) -
docs/pt/docs/tutorial/security/first-steps.md
```Python hl_lines="6" {!../../docs_src/security/tutorial001.py!} ``` /// tip | "Dica" ///
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.4K bytes - Viewed (0) -
docs/zh/docs/tutorial/security/first-steps.md
็่ณๅฏไปฅ่ฏด๏ผๅฎๆฏ้็จไบ็ปๅคงๅคๆฐ็จไพ็ๆไฝณๆนๆก๏ผ้ค้ๆจๆฏ OAuth2 ็ไธๅฎถ๏ผ็ฅ้ไธบไปไนๅ ถๅฎๆนๆกๆดๅ้ใ ๆฌไพไธญ๏ผ**FastAPI** ่ฟๆไพไบๆๅปบๅทฅๅ ทใ /// ๅๅปบ `OAuth2PasswordBearer` ็็ฑปๅฎไพๆถ๏ผ่ฆไผ ้ `tokenUrl` ๅๆฐใ่ฏฅๅๆฐๅ ๅซๅฎขๆท็ซฏ๏ผ็จๆทๆต่งๅจไธญ่ฟ่ก็ๅ็ซฏ๏ผ ็ URL๏ผ็จไบๅ้ `username` ไธ `password`๏ผๅนถ่ทๅไปค็ใ ```Python hl_lines="6" {!../../docs_src/security/tutorial001.py!} ``` /// tip | "ๆ็คบ" ๅจๆญค๏ผ`tokenUrl="token"` ๆๅ็ๆฏๆๆชๅๅปบ็็ธๅฏน URL `token`ใ่ฟไธช็ธๅฏน URL ็ธๅฝไบ `./token`ใ
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.3K bytes - Viewed (0) -
tests/test_security_oauth2_password_bearer_optional_description.py
from typing import Optional from fastapi import FastAPI, Security from fastapi.security import OAuth2PasswordBearer from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2PasswordBearer( tokenUrl="/token", description="OAuth2PasswordBearer security scheme", auto_error=False, ) @app.get("/items/") async def read_items(token: Optional[str] = Security(oauth2_scheme)): if token is None:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.2K bytes - Viewed (0) -
docs/en/docs/tutorial/security/first-steps.md
We will soon also create the actual path operation. /// info If you are a very strict "Pythonista" you might dislike the style of the parameter name `tokenUrl` instead of `token_url`. That's because it is using the same name as in the OpenAPI spec. So that if you need to investigate more about any of these security schemes you can just copy and paste it to find more information about it.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.2K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial001.py
} }, "components": { "securitySchemes": { "OAuth2PasswordBearer": { "type": "oauth2", "flows": {"password": {"scopes": {}, "tokenUrl": "token"}}, } } },
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.9K bytes - Viewed (0) -
docs_src/security/tutorial001.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 Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 10 17:28:18 UTC 2020 - 269 bytes - Viewed (0)