Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(oidc): add expected fields #1156

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading