|
|
|
@ -213,20 +213,27 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy) |
|
|
|
c.SupportedResponseTypes = []string{responseTypeCode} |
|
|
|
c.SupportedResponseTypes = []string{responseTypeCode} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
supportedGrant := []string{grantTypeAuthorizationCode, grantTypeRefreshToken, grantTypeDeviceCode} // default
|
|
|
|
supportedRes := make(map[string]bool) |
|
|
|
supportedRes := make(map[string]bool) |
|
|
|
|
|
|
|
|
|
|
|
for _, respType := range c.SupportedResponseTypes { |
|
|
|
for _, respType := range c.SupportedResponseTypes { |
|
|
|
switch respType { |
|
|
|
switch respType { |
|
|
|
case responseTypeCode, responseTypeIDToken, responseTypeToken: |
|
|
|
case responseTypeCode, responseTypeIDToken: |
|
|
|
|
|
|
|
// continue
|
|
|
|
|
|
|
|
case responseTypeToken: |
|
|
|
|
|
|
|
// response_type=token is an implicit flow, let's add it to the discovery info
|
|
|
|
|
|
|
|
// https://datatracker.ietf.org/doc/html/rfc6749#section-4.2.1
|
|
|
|
|
|
|
|
supportedGrant = append(supportedGrant, grantTypeImplicit) |
|
|
|
default: |
|
|
|
default: |
|
|
|
return nil, fmt.Errorf("unsupported response_type %q", respType) |
|
|
|
return nil, fmt.Errorf("unsupported response_type %q", respType) |
|
|
|
} |
|
|
|
} |
|
|
|
supportedRes[respType] = true |
|
|
|
supportedRes[respType] = true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
supportedGrant := []string{grantTypeAuthorizationCode, grantTypeRefreshToken, grantTypeDeviceCode} // default
|
|
|
|
|
|
|
|
if c.PasswordConnector != "" { |
|
|
|
if c.PasswordConnector != "" { |
|
|
|
supportedGrant = append(supportedGrant, grantTypePassword) |
|
|
|
supportedGrant = append(supportedGrant, grantTypePassword) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sort.Strings(supportedGrant) |
|
|
|
sort.Strings(supportedGrant) |
|
|
|
|
|
|
|
|
|
|
|
webFS := web.FS() |
|
|
|
webFS := web.FS() |
|
|
|
|