Results of 1 - 2 of about 2 for expires (0.007 sec.)
- OAuth2 scopes 11228
- OAuth2 scopes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use OAuth2 scopes directly with FastAPI , they are integrated to work seamlessly. This would
...ot verify_password ( password , user . hashed_password ): return False return user def create_access_token ( data : dict , expires_delta : timedelta | None = None ): to_encode = data . copy () if expires_delta : expire = datetime . now ( timezone . utc...) + expires_delta else : expire = datetime . now ( timezone . utc ) + timedelta ( minutes = 15 ) to_encode . update ({ "exp" : expire...assword ) if not user : raise HTTPException ( status_code = 400 , detail = "Incorrect username or password" ) access_token_expires = timedelta ( minutes = ACCESS_TOKEN_EXPIRE_MINUTES ) access_token = create_access_token ( data = { "sub" : user . usernam... - https://man.mtool.work/fastapi/0.115/advanced/security/oauth2-scopes/
- パスワード(およびハッシュ化)によるOAuth2、JWTトークンによるBearer 7485
- パスワード(およびハッシュ化)によるOAuth2、JWTトークンによるBearer これでセキュリティの流れが全てわかったので、 JWT トークンと安全なパスワードのハッシュ化を使用して、実際にアプリケーションを安全にしてみましょう。 このコードは、アプリケーシ
...ot verify_password ( password , user . hashed_password ): return False return user def create_access_token ( data : dict , expires_delta : Union [ timedelta , None ] = None ): to_encode = data . copy () if expires_delta : expire = datetime . now ( timez...one . utc ) + expires_delta else : expire = datetime . now ( timezone . utc ) + timedelta ( minutes = 15 ) to_encode . update ({ "exp" : expire...401_UNAUTHORIZED , detail = "Incorrect username or password" , headers = { "WWW-Authenticate" : "Bearer" }, ) access_token_expires = timedelta ( minutes = ACCESS_TOKEN_EXPIRE_MINUTES ) access_token = create_access_token ( data = { "sub" : user . usernam... - https://man.mtool.work/fastapi/0.115/tutorial/security/oauth2-jwt/
PREV
1
NEXT