Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 93 for Scopes (0.14 sec)

  1. docs/de/docs/advanced/security/oauth2-scopes.md

                        * Selbst keine erforderlichen Scopes.
                        * Eine Abhängigkeit, die `oauth2_scheme` verwendet.
                        * Einen `security_scopes`-Parameter vom Typ `SecurityScopes`:
                            * Dieser `security_scopes`-Parameter hat ein Attribut `scopes` mit einer `list`e, die alle oben deklarierten Scopes enthält, sprich:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:08 GMT 2024
    - 22.8K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/security/oauth2-scopes.md

                        * `security_scopes` 参数的类型是 `SecurityScopes`:
                            * `security_scopes` 参数的属性 `scopes` 是包含上述声明的所有作用域的**列表**,因此:
                                * `security_scopes.scopes` 包含用于*路径操作*的 `["me", "items"]`
                                * `security_scopes.scopes` 包含*路径操作* `read_users_me` 的 `["me"]`,因为它在依赖项里被声明
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:43:35 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  3. fastapi/security/oauth2.py

            data = {}
            data["scopes"] = []
            for scope in form_data.scopes:
                data["scopes"].append(scope)
            if form_data.client_id:
                data["client_id"] = form_data.client_id
            if form_data.client_secret:
                data["client_secret"] = form_data.client_secret
            return data
        ```
    
        Note that for OAuth2 the scope `items:read` is a single scope in an opaque string.
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  4. docs_src/security/tutorial005_an.py

                raise credentials_exception
            token_scopes = payload.get("scopes", [])
            token_data = TokenData(scopes=token_scopes, username=username)
        except (JWTError, ValidationError):
            raise credentials_exception
        user = get_user(fake_users_db, username=token_data.username)
        if user is None:
            raise credentials_exception
        for scope in security_scopes.scopes:
            if scope not in token_data.scopes:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  5. docs/de/docs/reference/dependencies.md

    ::: fastapi.Depends
    
    ## `Security()`
    
    In vielen Szenarien können Sie die Sicherheit (Autorisierung, Authentifizierung usw.) mit Abhängigkeiten handhaben, indem Sie `Depends()` verwenden.
    
    Wenn Sie jedoch auch OAuth2-Scopes deklarieren möchten, können Sie `Security()` anstelle von `Depends()` verwenden.
    
    Sie können `Security()` direkt von `fastapi` importieren:
    
    ```python
    from fastapi import Security
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 18:16:45 GMT 2024
    - 765 bytes
    - Viewed (0)
  6. fastapi/param_functions.py

                directly.
                """
            ),
        ] = None,
        *,
        scopes: Annotated[
            Optional[Sequence[str]],
            Doc(
                """
                OAuth2 scopes required for the *path operation* that uses this Security
                dependency.
    
                The term "scope" comes from the OAuth2 specification, it seems to be
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 62.5K bytes
    - Viewed (0)
  7. tests/test_security_oauth2_optional.py

                            },
                            "username": {"title": "Username", "type": "string"},
                            "password": {"title": "Password", "type": "string"},
                            "scope": {"title": "Scope", "type": "string", "default": ""},
                            "client_id": IsDict(
                                {
                                    "title": "Client Id",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  8. fastapi/params.py

        def __init__(
            self,
            dependency: Optional[Callable[..., Any]] = None,
            *,
            scopes: Optional[Sequence[str]] = None,
            use_cache: bool = True,
        ):
            super().__init__(dependency=dependency, use_cache=use_cache)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
  9. docs/en/docs/tutorial/security/oauth2-jwt.md

    <img src="/img/tutorial/security/image10.png">
    
    !!! note
        Notice the header `Authorization`, with a value that starts with `Bearer `.
    
    ## Advanced usage with `scopes`
    
    OAuth2 has the notion of "scopes".
    
    You can use them to add a specific set of permissions to a JWT token.
    
    Then you can give this token to a user directly or a third party, to interact with your API with a set of restrictions.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13K bytes
    - Viewed (0)
  10. docs_src/security/tutorial005_py310.py

                raise credentials_exception
            token_scopes = payload.get("scopes", [])
            token_data = TokenData(scopes=token_scopes, username=username)
        except (JWTError, ValidationError):
            raise credentials_exception
        user = get_user(fake_users_db, username=token_data.username)
        if user is None:
            raise credentials_exception
        for scope in security_scopes.scopes:
            if scope not in token_data.scopes:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
Back to top