OAuth2PasswordBearer auth/oauth2.pyを作成して、認証に必要な情報を記載します。 エンドポイントを認証によって保護する場合には、fastapi.securityのOAuth2PasswordBearerを用います。 python-multipartをインストールしていな方はpip install python-multipartをお願いします 認証機能のインスタンスを作成し、引数のtokenUrl='token'でトークン認証に用いるURLを指定しています。 ローカルの場合だと、127.0.0.1:8000/tokenをURLを指しています。こちらのエンドポイントは後程作成します。 エンドポイントに追加 作成出来たら任意のエンドポイントに認証機能を追加します。 from fastapi import APIRouter, Depends from sqlal
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く