Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 724 for username (0.17 sec)

  1. tests/test_tutorial/test_security/test_tutorial003.py

        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    def test_login_incorrect_username():
        response = client.post("/token", data={"username": "foo", "password": "secret"})
        assert response.status_code == 400, response.text
        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    def test_no_token():
        response = client.get("/users/me")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8K bytes
    - Viewed (0)
  2. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial008c_an_py39.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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 700 bytes
    - Viewed (0)
  4. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  5. docs_src/security/tutorial005_an_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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/NtlmUtil.java

        /**
         * 
         * @param domain
         * @param username
         * @param password
         * 
         * @return the caclulated mac
         */
        public static byte[] nTOWFv2 ( String domain, String username, String password ) {
            return nTOWFv2(domain, username, getNTHash(password));
        }
    
    
        /**
         * 
         * @param domain
         * @param username
         * @param passwordHash
    Java
    - Registered: Sun Apr 28 00:10:09 GMT 2024
    - Last Modified: Tue Jul 07 12:07:20 GMT 2020
    - 9.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_security/test_tutorial003_an_py39.py

        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    @needs_py39
    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_py39
    def test_no_token(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  8. docs/multi-user/README.md

    - `aws:username` - This is a string containing the friendly name of the current user, this value would point to STS temporary credential in `AssumeRole`ed requests, use `jwt:preferred_username` in case of OpenID connect and `ldap:username` in case of AD/LDAP. *aws:userid* is an alias to *aws:username* in MinIO.
    Plain Text
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Mar 21 06:38:06 GMT 2023
    - 8K bytes
    - Viewed (0)
  9. docs_src/security/tutorial003.py

    oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
    
    
    class User(BaseModel):
        username: str
        email: Union[str, None] = None
        full_name: Union[str, None] = None
        disabled: Union[bool, None] = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    def get_user(db, username: str):
        if username in db:
            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def fake_decode_token(token):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 2.4K bytes
    - Viewed (0)
  10. docs_src/configure_swagger_ui/tutorial003.py

    from fastapi import FastAPI
    
    app = FastAPI(swagger_ui_parameters={"deepLinking": False})
    
    
    @app.get("/users/{username}")
    async def read_user(username: str):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 201 bytes
    - Viewed (0)
Back to top