Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 77 for OAuth (0.14 sec)

  1. tests/test_swagger_ui_init_oauth.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    swagger_ui_init_oauth = {"clientId": "the-foo-clients", "appName": "The Predendapp"}
    
    app = FastAPI(swagger_ui_init_oauth=swagger_ui_init_oauth)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Aug 09 10:54:05 GMT 2020
    - 718 bytes
    - Viewed (0)
  2. tests/test_security_api_key_cookie_optional.py

    app = FastAPI()
    
    api_key = APIKeyCookie(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        if current_user is None:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  3. tests/test_security_openid_connect_optional.py

    app = FastAPI()
    
    oid = OpenIdConnect(openIdConnectUrl="/openid", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(oid)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: Optional[User] = Depends(get_current_user)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/security/index.md

    Sie umfasst Möglichkeiten zur Authentifizierung mithilfe eines „Dritten“ („third party“).
    
    Das ist es, was alle diese „Login mit Facebook, Google, Twitter, GitHub“-Systeme unter der Haube verwenden.
    
    ### OAuth 1
    
    Es gab ein OAuth 1, das sich stark von OAuth2 unterscheidet und komplexer ist, da es direkte Spezifikationen enthält, wie die Kommunikation verschlüsselt wird.
    
    Heutzutage ist es nicht sehr populär und wird kaum verwendet.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:09:35 GMT 2024
    - 5K bytes
    - Viewed (0)
  5. tests/test_security_api_key_query.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyQuery(name="key")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        return current_user
    
    
    client = TestClient(app)
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  6. tests/test_security_api_key_cookie_description.py

    app = FastAPI()
    
    api_key = APIKeyCookie(name="key", description="An API Cookie Key")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        return current_user
    
    
    def test_security_api_key():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  7. tests/test_security_api_key_header_optional.py

    app = FastAPI()
    
    api_key = APIKeyHeader(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: Optional[User] = Depends(get_current_user)):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  8. tests/test_security_api_key_header_description.py

    app = FastAPI()
    
    api_key = APIKeyHeader(name="key", description="An API Key Header")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        return current_user
    
    
    client = TestClient(app)
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/security/index.md

    ## OAuth2
    
    OAuth2是一个规范,它定义了几种处理身份认证和授权的方法。
    
    它是一个相当广泛的规范,涵盖了一些复杂的使用场景。
    
    它包括了使用「第三方」进行身份认证的方法。
    
    这就是所有带有「使用 Facebook,Google,Twitter,GitHub 登录」的系统背后所使用的机制。
    
    ### OAuth 1
    
    有一个 OAuth 1,它与 OAuth2 完全不同,并且更为复杂,因为它直接包含了有关如何加密通信的规范。
    
    如今它已经不是很流行,没有被广泛使用了。
    
    OAuth2 没有指定如何加密通信,它期望你为应用程序使用 HTTPS 进行通信。
    
    !!! tip
        在有关**部署**的章节中,你将了解如何使用 Traefik 和 Let's Encrypt 免费设置 HTTPS。
    
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jun 24 14:47:15 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  10. docs/sts/wso2.md

      - Navigate to service provider section, expand Inbound Authentication Configurations and expand OAuth/OpenID Connect Configuration.
        - Copy the OAuth Client Key as the value for `<CLIENT_ID>`.
    Plain Text
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Sep 29 04:28:45 GMT 2022
    - 8.7K bytes
    - Viewed (0)
Back to top