- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 65 for UserName (0.24 sec)
-
docs/zh/docs/tutorial/security/simple-oauth2.md
本章添加上一章示例中欠缺的部分,实现完整的安全流。 ## 获取 `username` 和 `password` 首先,使用 **FastAPI** 安全工具获取 `username` 和 `password`。 OAuth2 规范要求使用**密码流**时,客户端或用户必须以表单数据形式发送 `username` 和 `password` 字段。 并且,这两个字段必须命名为 `username` 和 `password` ,不能使用 `user-name` 或 `email` 等其它名称。 不过也不用担心,前端仍可以显示终端用户所需的名称。 数据库模型也可以使用所需的名称。 但对于登录*路径操作*,则要使用兼容规范的 `username` 和 `password`,(例如,实现与 API 文档集成)。 该规范要求必须以表单数据形式发送 `username` 和 `password`,因此,不能使用 JSON 对象。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.8K bytes - Viewed (0) -
docs/ja/docs/tutorial/request-forms.md
`Body`や`Query`の場合と同じようにフォームパラメータを作成します: ```Python hl_lines="7" {!../../../docs_src/request_forms/tutorial001.py!} ``` 例えば、OAuth2仕様が使用できる方法の1つ(「パスワードフロー」と呼ばれる)では、フォームフィールドとして`username`と`password`を送信する必要があります。 <abbr title="仕様">仕様</abbr>では、フィールドの名前が`username`と`password`であることと、JSONではなくフォームフィールドとして送信されることを要求しています。 `Form`では`Body`(および`Query`や`Path`、`Cookie`)と同じメタデータとバリデーションを宣言することができます。 !!! info "情報" `Form`は`Body`を直接継承するクラスです。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 3.3K bytes - Viewed (0) -
docs/zh/docs/tutorial/security/get-current-user.md
而不是局限于只能有一个返回该类型数据的依赖项。 ## 其它模型 接下来,直接在*路径操作函数*中获取当前用户,并用 `Depends` 在**依赖注入**系统中处理安全机制。 开发者可以使用任何模型或数据满足安全需求(本例中是 Pydantic 的 `User` 模型)。 而且,不局限于只能使用特定的数据模型、类或类型。 不想在模型中使用 `username`,而是使用 `id` 和 `email`?当然可以。这些工具也支持。 只想使用字符串?或字典?甚至是数据库类模型的实例?工作方式都一样。 实际上,就算登录应用的不是用户,而是只拥有访问令牌的机器人、程序或其它系统?工作方式也一样。 尽管使用应用所需的任何模型、类、数据库。**FastAPI** 通过依赖注入系统都能帮您搞定。 ## 代码大小
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 22:46:46 GMT 2024 - 3.5K bytes - Viewed (0) -
docs/em/docs/tutorial/security/simple-oauth2.md
# 🙅 Oauth2️⃣ ⏮️ 🔐 & 📨 🔜 ➡️ 🏗 ⚪️➡️ ⏮️ 📃 & 🚮 ❌ 🍕 ✔️ 🏁 💂♂ 💧. ## 🤚 `username` & `password` 👥 🔜 ⚙️ **FastAPI** 💂♂ 🚙 🤚 `username` & `password`. Oauth2️⃣ ✔ 👈 🕐❔ ⚙️ "🔐 💧" (👈 👥 ⚙️) 👩💻/👩💻 🔜 📨 `username` & `password` 🏑 📨 💽. & 🔌 💬 👈 🏑 ✔️ 🌟 💖 👈. `user-name` ⚖️ `email` 🚫🔜 👷. ✋️ 🚫 😟, 👆 💪 🎦 ⚫️ 👆 🎋 👆 🏁 👩💻 🕸. & 👆 💽 🏷 💪 ⚙️ 🙆 🎏 📛 👆 💚.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.9K bytes - Viewed (0) -
docs/en/docs/tutorial/security/first-steps.md
So, let's review it from that simplified point of view: * The user types the `username` and `password` in the frontend, and hits `Enter`. * The frontend (running in the user's browser) sends that `username` and `password` to a specific URL in our API (declared with `tokenUrl="token"`). * The API checks that `username` and `password`, and responds with a "token" (we haven't implemented any of this yet).
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 8.9K bytes - Viewed (0) -
docs/en/docs/how-to/nosql-databases-couchbase.md
## Get the user Now create a function that will: * Take a username. * Generate a document ID from it. * Get the document with that ID. * Put the contents of the document in a `UserInDB` model.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 16 13:23:25 GMT 2024 - 6K bytes - Viewed (0) -
docs/em/docs/advanced/security/oauth2-scopes.md
{!../../../docs_src/security/tutorial005.py!} ``` ## ✔ `username` & 💽 💠 👥 ✔ 👈 👥 🤚 `username`, & ⚗ ↔. & ⤴️ 👥 ✔ 👈 📊 ⏮️ Pydantic 🏷 (✊ `ValidationError` ⚠), & 🚥 👥 🤚 ❌ 👂 🥙 🤝 ⚖️ ⚖ 📊 ⏮️ Pydantic, 👥 🤚 `HTTPException` 👥 ✍ ⏭. 👈, 👥 ℹ Pydantic 🏷 `TokenData` ⏮️ 🆕 🏠 `scopes`. ⚖ 📊 ⏮️ Pydantic 👥 💪 ⚒ 💭 👈 👥 ✔️, 🖼, ⚫️❔ `list` `str` ⏮️ ↔ & `str` ⏮️ `username`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 21:21:35 GMT 2024 - 11.1K bytes - Viewed (0) -
docs/en/docs/tutorial/security/get-current-user.md
But you are not restricted to using some specific data model, class or type. Do you want to have an `id` and `email` and not have any `username` in your model? Sure. You can use these same tools. Do you want to just have a `str`? Or just a `dict`? Or a database class model instance directly? It all works the same way.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 7.6K bytes - Viewed (0) -
docs/zh/docs/tutorial/request-forms.md
## 定义 `Form` 参数 创建表单(`Form`)参数的方式与 `Body` 和 `Query` 一样: ```Python hl_lines="7" {!../../../docs_src/request_forms/tutorial001.py!} ``` 例如,OAuth2 规范的 "密码流" 模式规定要通过表单字段发送 `username` 和 `password`。 <abbr title="specification">该规范</abbr>要求字段必须命名为 `username` 和 `password`,并通过表单字段发送,不能用 JSON。 使用 `Form` 可以声明与 `Body` (及 `Query`、`Path`、`Cookie`)相同的元数据和验证。 !!! info "说明" `Form` 是直接继承自 `Body` 的类。 !!! tip "提示"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Mar 13 19:02:19 GMT 2024 - 2.2K bytes - Viewed (0) -
docs/en/docs/tutorial/security/oauth2-jwt.md
So, to avoid ID collisions, when creating the JWT token for the user, you could prefix the value of the `sub` key, e.g. with `username:`. So, in this example, the value of `sub` could have been: `username:johndoe`. The important thing to keep in mind is that the `sub` key should have a unique identifier across the entire application, and it should be a string. ## Check it
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)