first draft

This commit is contained in:
James Batt 2022-04-15 14:07:32 +10:00
parent a6ad6604aa
commit 2140cbf33c
3 changed files with 4 additions and 5 deletions

View file

@ -27,6 +27,7 @@ type Configuration interface {
GrantTypeRefreshTokenSupported() bool
GrantTypeTokenExchangeSupported() bool
GrantTypeJWTAuthorizationSupported() bool
GrantTypeClientCredentialsSupported() bool
IntrospectionAuthMethodPrivateKeyJWTSupported() bool
IntrospectionEndpointSigningAlgorithmsSupported() []string
RevocationAuthMethodPrivateKeyJWTSupported() bool

View file

@ -75,6 +75,9 @@ func GrantTypes(c Configuration) []oidc.GrantType {
if c.GrantTypeRefreshTokenSupported() {
grantTypes = append(grantTypes, oidc.GrantTypeRefreshToken)
}
if c.GrantTypeClientCredentialsSupported() {
grantTypes = append(grantTypes, oidc.GrantTypeClientCredentials)
}
if c.GrantTypeTokenExchangeSupported() {
grantTypes = append(grantTypes, oidc.GrantTypeTokenExchange)
}

View file

@ -98,11 +98,6 @@ func AuthorizeClientCredentialsClient(ctx context.Context, request *oidc.ClientC
return nil, oidc.ErrUnauthorizedClient()
}
am := client.AuthMethod()
if am != oidc.AuthMethodBasic || am != oidc.AuthMethodPost {
return nil, oidc.ErrInvalidClient().WithDescription("auth_method %s not supported for client_credentials grant.", am)
}
return client, nil
}