- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for get_token (0.06 sec)
-
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py
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 app = FastAPI(dependencies=[Depends(get_token)]) @app.get("/") async def root(): return {"message": "Hello World"} @app.get( "/with-oauth2-scheme",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.6K bytes - Viewed (0) -
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py
tokenUrl="/api/oauth/token", scopes={"read": "Read access", "write": "Write access"}, ) async def get_token(token: Annotated[str, Depends(oauth2_scheme)]) -> str: return token app = FastAPI(dependencies=[Depends(get_token)]) @app.get("/admin", dependencies=[Security(get_token, scopes=["read", "write"])]) async def read_admin(): return {"message": "Admin Access"} client = TestClient(app)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_tutorial/test_security/test_tutorial001.py
response = client.get("/items") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(client: TestClient): response = client.get("/items", headers={"Authorization": "Bearer testtoken"}) assert response.status_code == 200, response.text assert response.json() == {"token": "testtoken"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial002.py
response = client.get("/users/me") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(client: TestClient): response = client.get("/users/me", headers={"Authorization": "Bearer testtoken"}) assert response.status_code == 200, response.text assert response.json() == {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial003.py
response = client.get("/users/me") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(client: TestClient): response = client.get("/users/me", headers={"Authorization": "Bearer johndoe"}) assert response.status_code == 200, response.text assert response.json() == { "username": "johndoe",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 7.7K bytes - Viewed (0) -
tests/test_dependency_yield_scope_websockets.py
match='The dependency "get_named_func_session" has a scope of "request", it cannot depend on dependencies with scope "function"', ): @app.websocket("/broken-scope") async def get_broken( websocket: WebSocket, sessions: BrokenSessionsDep ) -> Any: # pragma: no cover pass def test_named_function_scope() -> None: global_context.set({})
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6K bytes - Viewed (0) -
tests/test_dependency_yield_scope.py
FastAPIError, match='The dependency "get_named_func_session" has a scope of "request", it cannot depend on dependencies with scope "function"', ): @app.get("/broken-scope") def get_broken(sessions: BrokenSessionsDep) -> Any: # pragma: no cover pass def test_named_function_scope() -> None: response = client.get("/named-function-scope") assert response.status_code == 200Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 6.7K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial004.py
response = client.get("/users/me") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(mod: ModuleType): client = TestClient(mod.app) access_token = get_access_token(client=client) response = client.get( "/users/me", headers={"Authorization": f"Bearer {access_token}"} )
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 13.3K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005.py
response = client.get("/users/me") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(mod: ModuleType): client = TestClient(mod.app) access_token = get_access_token(scope="me", client=client) response = client.get( "/users/me", headers={"Authorization": f"Bearer {access_token}"} )
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 15.8K bytes - Viewed (0) -
src/main/java/org/codelibs/fess/sso/entraid/EntraIdAuthenticator.java
* @param oidcResponse The OpenID Connect authentication success response. */ protected void validateAuthRespMatchesCodeFlow(final AuthenticationSuccessResponse oidcResponse) { if (oidcResponse.getIDToken() != null || oidcResponse.getAccessToken() != null || oidcResponse.getAuthorizationCode() == null) { throw new SsoLoginException("unexpected set of artifacts received"); } } /**Registered: Sat Dec 20 09:19:18 UTC 2025 - Last Modified: Sat Dec 13 02:21:17 UTC 2025 - 56.7K bytes - Viewed (0)