Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for used (0.12 sec)

  1. docs/zh/docs/tutorial/security/oauth2-jwt.md

    创建设置令牌过期时间的变量。
    
    定义令牌端点响应的 Pydantic 模型。
    
    创建生成新的访问令牌的工具函数。
    
    ```Python hl_lines="6  12-14  28-30  78-86"
    {!../../../docs_src/security/tutorial004.py!}
    ```
    
    ## 更新依赖项
    
    更新 `get_current_user` 以接收与之前相同的令牌,但这里用的是 JWT 令牌。
    
    解码并校验接收到的令牌,然后,返回当前用户。
    
    如果令牌无效,则直接返回 HTTP 错误。
    
    ```Python hl_lines="89-106"
    {!../../../docs_src/security/tutorial004.py!}
    ```
    
    ## 更新 `/token` *路径操作*
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/security/oauth2-jwt.md

    The JWT specification says that there's a key `sub`, with the subject of the token.
    
    It's optional to use it, but that's where you would put the user's identification, so we are using it here.
    
    JWT might be used for other things apart from identifying a user and allowing them to perform operations directly on your API.
    
    For example, you could identify a "car" or a "blog post".
    
    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)
  3. docs/ja/docs/tutorial/security/oauth2-jwt.md

    レスポンスのトークンエンドポイントで使用するPydanticモデルを定義します。
    
    新しいアクセストークンを生成するユーティリティ関数を作成します。
    
    ```Python hl_lines="6  12-14  28-30  78-86"
    {!../../../docs_src/security/tutorial004.py!}
    ```
    
    ## 依存関係の更新
    
    `get_current_user`を更新して、先ほどと同じトークンを受け取るようにしますが、今回はJWTトークンを使用します。
    
    受け取ったトークンを復号して検証し、現在のユーザーを返します。
    
    トークンが無効な場合は、すぐにHTTPエラーを返します。
    
    ```Python hl_lines="89-106"
    {!../../../docs_src/security/tutorial004.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/security/oauth2-jwt.md

        ```Python hl_lines="6  12-14  28-30  78-86"
        {!> ../../../docs_src/security/tutorial004.py!}
        ```
    
    ## Die Abhängigkeiten aktualisieren
    
    Aktualisieren Sie `get_current_user`, um den gleichen Token wie zuvor zu erhalten, dieses Mal jedoch unter Verwendung von JWT-Tokens.
    
    Dekodieren Sie den empfangenen Token, validieren Sie ihn und geben Sie den aktuellen Benutzer zurück.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:27:06 GMT 2024
    - 15.1K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/security/oauth2-jwt.md

        ```
    
    === "🐍 3️⃣.1️⃣0️⃣ & 🔛"
    
        ```Python hl_lines="5  11-13  27-29  77-85"
        {!> ../../../docs_src/security/tutorial004_py310.py!}
        ```
    
    ## ℹ 🔗
    
    ℹ `get_current_user` 📨 🎏 🤝 ⏭, ✋️ 👉 🕰, ⚙️ 🥙 🤝.
    
    🔣 📨 🤝, ✔ ⚫️, & 📨 ⏮️ 👩‍💻.
    
    🚥 🤝 ❌, 📨 🇺🇸🔍 ❌ ▶️️ ↖️.
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
        ```Python hl_lines="89-106"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top