Skip to content

Commit

Permalink
fix(oidc): add expected fields (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanSussman committed Jul 10, 2024
1 parent b24411e commit 02047db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion api/oi_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func GetOpenIDConfig(c *gin.Context) {
config := types.OpenIDConfig{
Issuer: fmt.Sprintf("%s/_services/token", m.Vela.Address),
JWKSAddress: fmt.Sprintf("%s/%s", m.Vela.Address, "_services/token/.well-known/jwks"),
SupportedClaims: []string{
ClaimsSupported: []string{
"sub",
"exp",
"iat",
Expand All @@ -59,9 +59,15 @@ func GetOpenIDConfig(c *gin.Context) {
"sha",
"ref",
},
ResponseTypesSupported: []string{
"id_token",
},
Algorithms: []string{
jwt.SigningMethodRS256.Name,
},
SubjectTypesSupported: []string{
"public",
},
}

c.JSON(http.StatusOK, config)
Expand Down
10 changes: 6 additions & 4 deletions api/types/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (
//
// swagger:model OpenIDConfig
type OpenIDConfig struct {
Issuer string `json:"issuer"`
JWKSAddress string `json:"jwks_uri"`
SupportedClaims []string `json:"supported_claims"`
Algorithms []string `json:"id_token_signing_alg_values_supported"`
Issuer string `json:"issuer"`
JWKSAddress string `json:"jwks_uri"`
ClaimsSupported []string `json:"claims_supported"`
Algorithms []string `json:"id_token_signing_alg_values_supported"`
ResponseTypesSupported []string `json:"response_types_supported"`
SubjectTypesSupported []string `json:"subject_types_supported"`
}

// OpenIDClaims struct is an extension of the JWT standard claims. It
Expand Down

0 comments on commit 02047db

Please sign in to comment.