Open habu-ori opened 1 year ago
JWTに含まれるclaimsは、2者間で情報を伝達するために使用される。
claims
このclaimsは、その時のユースケースに合わせて決定する。
JWTは3つの部分からなる文字列で、ドット(.)で区切られ、base64でシリアライズされる。
最も一般的なシリアライズ形式であるコンパクトシリアライズでは、JWTは以下のようになる。
xxxxx.yyyyy.zzzzz.
デコードされると、2つのJSON文字列(headerとpayroad)が得られる。
header
payroad
JOSE(JSON Object Signing and Encryption)headerには、トークンの種類(この場合はJWT)と署名アルゴリズムが含まれている。 payroadには、claimsが含まれる。
OAuthベアラ・トークン
sequenceDiagram autonumber client クライアント participant server as サーバー クライアント->>server: GET /doc HTTP/1.1 server->>クライアント: HTTP/1.1 200 OK
JWTとは何か?
JWTの仕組み
JWTに含まれる
claims
は、2者間で情報を伝達するために使用される。この
claims
は、その時のユースケースに合わせて決定する。JWTは3つの部分からなる文字列で、ドット(.)で区切られ、base64でシリアライズされる。
最も一般的なシリアライズ形式であるコンパクトシリアライズでは、JWTは以下のようになる。
デコードされると、2つのJSON文字列(
header
とpayroad
)が得られる。JOSE(JSON Object Signing and Encryption)headerには、トークンの種類(この場合はJWT)と署名アルゴリズムが含まれている。 payroadには、
claims
が含まれる。JWTの例
OAuthベアラ・トークン
なぜJWTを使用するのか?