diff --git a/handler/openid/strategy_jwt.go b/handler/openid/strategy_jwt.go index 2e6cfe57..24f230fc 100644 --- a/handler/openid/strategy_jwt.go +++ b/handler/openid/strategy_jwt.go @@ -51,11 +51,11 @@ type Session interface { // IDTokenSession is a session container for the id token type DefaultSession struct { - Claims *jwt.IDTokenClaims - Headers *jwt.Headers - ExpiresAt map[fosite.TokenType]time.Time - Username string - Subject string + Claims *jwt.IDTokenClaims `json:"id_token_claims"` + Headers *jwt.Headers `json:"headers"` + ExpiresAt map[fosite.TokenType]time.Time `json:"expires_at"` + Username string `json:"username"` + Subject string `json:"subject"` } func NewDefaultSession() *DefaultSession { diff --git a/token/jwt/claims_id_token.go b/token/jwt/claims_id_token.go index 8071abe6..5c12ff61 100644 --- a/token/jwt/claims_id_token.go +++ b/token/jwt/claims_id_token.go @@ -29,20 +29,20 @@ import ( // IDTokenClaims represent the claims used in open id connect requests type IDTokenClaims struct { - JTI string - Issuer string - Subject string - Audience []string - Nonce string - ExpiresAt time.Time - IssuedAt time.Time - RequestedAt time.Time - AuthTime time.Time - AccessTokenHash string - AuthenticationContextClassReference string - AuthenticationMethodsReferences []string - CodeHash string - Extra map[string]interface{} + JTI string `json:"jti"` + Issuer string `json:"iss"` + Subject string `json:"sub"` + Audience []string `json:"aud"` + Nonce string `json:"nonce"` + ExpiresAt time.Time `json:"exp"` + IssuedAt time.Time `json:"iat"` + RequestedAt time.Time `json:"rat"` + AuthTime time.Time `json:"auth_time"` + AccessTokenHash string `json:"at_hash"` + AuthenticationContextClassReference string `json:"acr"` + AuthenticationMethodsReferences []string `json:"amr"` + CodeHash string `json:"c_hash"` + Extra map[string]interface{} `json:"ext"` } // ToMap will transform the headers to a map structure diff --git a/token/jwt/header.go b/token/jwt/header.go index f790a230..c89f1641 100644 --- a/token/jwt/header.go +++ b/token/jwt/header.go @@ -23,7 +23,7 @@ package jwt // Headers is the jwt headers type Headers struct { - Extra map[string]interface{} + Extra map[string]interface{} `json:"extra"` } func NewHeaders() *Headers {