feat(jwt): add azp claim to ID token (#3570)

Added the `azp` (Authorized Party) claim to various JWT token structures
including Claims, ClaimsShort, ClaimsWithoutThirdIdp, and ClaimsStandard.
Updated the generateJwtToken and getClaimsCustom functions to handle the
new claim. This change aligns with the OpenID Connect specification.
This commit is contained in:
Brian Yu
2025-02-10 20:44:44 +08:00
committed by GitHub
parent a0931e4597
commit b1b6ebe692
2 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,7 @@ type ClaimsStandard struct {
Nonce string `json:"nonce,omitempty"`
Scope string `json:"scope,omitempty"`
Address OIDCAddress `json:"address,omitempty"`
Azp string `json:"azp,omitempty"`
jwt.RegisteredClaims
}
@ -52,6 +53,7 @@ func getStandardClaims(claims Claims) ClaimsStandard {
Nonce: claims.Nonce,
Scope: claims.Scope,
RegisteredClaims: claims.RegisteredClaims,
Azp: claims.Azp,
}
res.Phone = ""