Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 237 for UserName (0.17 sec)

  1. docs_src/dependencies/tutorial008c_an.py

    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 710 bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/fess/app/service/UserService.java

            });
    
        }
    
        public void changePassword(final String username, final String password) {
            final boolean changed = ComponentUtil.getAuthenticationManager().changePassword(username, password);
            if (changed) {
                userBhv.selectEntity(cb -> cb.query().setName_Equal(username)).ifPresent(entity -> {
                    final String encodedPassword = fessLoginAssist.encryptPassword(password);
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/extra-models.md

    ```Python
    UserInDB(**user_dict)
    ```
    
    就会生成如下结果:
    
    ```Python
    UserInDB(
        username="john",
        password="secret",
        email="******@****.***",
        full_name=None,
    )
    ```
    
    或更精准,直接把可能会用到的内容与 `user_dict` 一起使用:
    
    ```Python
    UserInDB(
        username = user_dict["username"],
        password = user_dict["password"],
        email = user_dict["email"],
        full_name = user_dict["full_name"],
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 01:15:53 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_security/test_tutorial005_an_py310.py

        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py310
    def test_login_incorrect_username(client: TestClient):
        response = client.post("/token", data={"username": "foo", "password": "secret"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py310
    def test_no_token(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/fess/app/web/profile/ProfileAction.java

            validatePasswordForm(form, toIndexPage);
            final String username = getUserBean().map(FessUserBean::getUserId).get();
            try {
                userService.changePassword(username, form.newPassword);
                saveInfo(messages -> messages.addSuccessChangedPassword(GLOBAL));
            } catch (final Exception e) {
                logger.warn("Failed to change password for {}", username, e);
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  6. 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)
  7. fastapi/security/oauth2.py

                    """
                ),
            ] = None,
            username: Annotated[
                str,
                Form(),
                Doc(
                    """
                    `username` string. The OAuth2 spec requires the exact field name
                    `username`.
                    """
                ),
            ],
            password: Annotated[
                str,
    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)
  8. docs/de/docs/tutorial/extra-models.md

    UserInDB(**user_dict)
    ```
    
    dann ist das ungefähr äquivalent zu:
    
    ```Python
    UserInDB(
        username="john",
        password="secret",
        email="******@****.***",
        full_name=None,
    )
    ```
    
    Oder, präziser, `user_dict` wird direkt verwendet, welche Werte es auch immer haben mag:
    
    ```Python
    UserInDB(
        username = user_dict["username"],
        password = user_dict["password"],
        email = user_dict["email"],
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  9. docs_src/security/tutorial007_an_py39.py

    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"
        is_correct_username = secrets.compare_digest(
            current_username_bytes, correct_username_bytes
        )
        current_password_bytes = credentials.password.encode("utf8")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  10. docs_src/security/tutorial005_py310.py

            username: str = payload.get("sub")
            if username is None:
                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:
    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