- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for OAuth2AuthorizationCodeBearer (0.12 sec)
-
tests/test_security_oauth2_authorization_code_bearer.py
from typing import Optional from fastapi import FastAPI, Security 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}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.3K bytes - Viewed (0) -
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py
from typing import Annotated from fastapi import Depends, FastAPI, Security from fastapi.security import OAuth2AuthorizationCodeBearer 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"}, )Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 2.6K bytes - Viewed (0) -
tests/test_security_oauth2_authorization_code_bearer_description.py
from typing import Optional from fastapi import FastAPI, Security 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/")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.4K bytes - Viewed (0) -
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py
from typing import Annotated, Optional from fastapi import APIRouter, Depends, FastAPI, Security 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"}, )Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.6K bytes - Viewed (0) -
docs/en/docs/reference/security/index.md
APIKeyCookie, APIKeyHeader, APIKeyQuery, HTTPAuthorizationCredentials, HTTPBasic, HTTPBasicCredentials, HTTPBearer, HTTPDigest, OAuth2, OAuth2AuthorizationCodeBearer, OAuth2PasswordBearer, OAuth2PasswordRequestForm, OAuth2PasswordRequestFormStrict, OpenIdConnect, SecurityScopes, ) ``` ## API Key Security SchemesRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 1.6K bytes - Viewed (0) -
fastapi/security/oauth2.py
if self.auto_error: raise self.make_not_authenticated_error() else: return None return param class OAuth2AuthorizationCodeBearer(OAuth2): """ 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__(Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 22K bytes - Viewed (0) -
docs/en/docs/release-notes.md
* Add link to Chinese article in [External Links](https://fastapi.tiangolo.com/external-links/). PR [810](https://github.com/tiangolo/fastapi/pull/810) by [@wxq0309](https://github.com/wxq0309). * Implement `OAuth2AuthorizationCodeBearer` class. PR [#797](https://github.com/tiangolo/fastapi/pull/797) by [@kuwv](https://github.com/kuwv).
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 19:06:15 UTC 2025 - 586.7K bytes - Viewed (0)