- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 21 for HTTPBasicCredentials (1.21 seconds)
-
docs_src/security/tutorial006_an_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 361 bytes - Click Count (0) -
docs_src/security/tutorial006_py310.py
from fastapi import Depends, FastAPI from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() @app.get("/users/me") def read_current_user(credentials: HTTPBasicCredentials = Depends(security)):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 321 bytes - Click Count (0) -
tests/test_security_http_basic_realm_description.py
from fastapi import FastAPI, Security from fastapi.security import HTTPBasic, HTTPBasicCredentials from fastapi.testclient import TestClient from inline_snapshot import snapshot app = FastAPI() security = HTTPBasic(realm="simple", description="HTTPBasic scheme") @app.get("/users/me") def read_current_user(credentials: HTTPBasicCredentials = Security(security)):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 2.9K bytes - Click Count (0) -
fastapi/security/__init__.py
from .api_key import APIKeyQuery as APIKeyQuery from .http import HTTPAuthorizationCredentials as HTTPAuthorizationCredentials from .http import HTTPBasic as HTTPBasic from .http import HTTPBasicCredentials as HTTPBasicCredentials from .http import HTTPBearer as HTTPBearer from .http import HTTPDigest as HTTPDigest from .oauth2 import OAuth2 as OAuth2 from .oauth2 import OAuth2AuthorizationCodeBearer as OAuth2AuthorizationCodeBearer
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Dec 20 18:50:00 GMT 2020 - 881 bytes - Click Count (0) -
tests/test_security_http_basic_realm.py
from base64 import b64encode from fastapi import FastAPI, Security from fastapi.security import HTTPBasic, HTTPBasicCredentials from fastapi.testclient import TestClient from inline_snapshot import snapshot app = FastAPI() security = HTTPBasic(realm="simple") @app.get("/users/me") def read_current_user(credentials: HTTPBasicCredentials = Security(security)): return {"username": credentials.username, "password": credentials.password}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 2.7K bytes - Click Count (0) -
tests/test_security_http_basic_optional.py
from base64 import b64encode from fastapi import FastAPI, Security from fastapi.security import HTTPBasic, HTTPBasicCredentials from fastapi.testclient import TestClient from inline_snapshot import snapshot app = FastAPI() security = HTTPBasic(auto_error=False) @app.get("/users/me") def read_current_user(credentials: HTTPBasicCredentials | None = Security(security)): if credentials is None:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.7K bytes - Click Count (0) -
docs_src/security/tutorial007_py310.py
import secrets from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() def get_current_username(credentials: HTTPBasicCredentials = Depends(security)): current_username_bytes = credentials.username.encode("utf8") correct_username_bytes = b"stanleyjobson" is_correct_username = secrets.compare_digest(
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 1.1K bytes - Click Count (0) -
docs_src/security/tutorial007_an_py310.py
import secrets from typing import Annotated from fastapi import Depends, FastAPI, HTTPException, status from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() def get_current_username( credentials: Annotated[HTTPBasicCredentials, Depends(security)], ): current_username_bytes = credentials.username.encode("utf8") correct_username_bytes = b"stanleyjobson"
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 1.1K bytes - Click Count (0) -
docs/en/docs/advanced/security/http-basic-auth.md
## Simple HTTP Basic Auth { #simple-http-basic-auth } * Import `HTTPBasic` and `HTTPBasicCredentials`. * Create a "`security` scheme" using `HTTPBasic`. * Use that `security` with a dependency in your *path operation*. * It returns an object of type `HTTPBasicCredentials`: * It contains the `username` and `password` sent. {* ../../docs_src/security/tutorial006_an_py310.py hl[4,8,12] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 5K bytes - Click Count (0) -
docs/ko/docs/advanced/security/http-basic-auth.md
그다음 사용자명과 비밀번호를 입력하면, 브라우저가 자동으로 해당 값을 헤더에 담아 전송합니다. ## 간단한 HTTP Basic Auth { #simple-http-basic-auth } * `HTTPBasic`과 `HTTPBasicCredentials`를 임포트합니다. * `HTTPBasic`을 사용해 "`security` scheme"을 생성합니다. * *경로 처리*에서 dependency로 해당 `security`를 사용합니다. * `HTTPBasicCredentials` 타입의 객체를 반환합니다: * 전송된 `username`과 `password`를 포함합니다. {* ../../docs_src/security/tutorial006_an_py310.py hl[4,8,12] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 5.9K bytes - Click Count (0)