handle client credentials in VerifyClient
This commit is contained in:
parent
d27be590c4
commit
b7cbe15ced
2 changed files with 19 additions and 15 deletions
|
@ -105,6 +105,14 @@ func (s *LegacyServer) DeviceAuthorization(ctx context.Context, r *ClientRequest
|
|||
}
|
||||
|
||||
func (s *LegacyServer) VerifyClient(ctx context.Context, r *Request[ClientCredentials]) (Client, error) {
|
||||
if oidc.GrantType(r.Form.Get("grant_type")) == oidc.GrantTypeClientCredentials {
|
||||
storage, ok := s.provider.Storage().(ClientCredentialsStorage)
|
||||
if !ok {
|
||||
return nil, oidc.ErrUnsupportedGrantType().WithDescription("client_credentials grant not supported")
|
||||
}
|
||||
return storage.ClientCredentials(ctx, r.Data.ClientID, r.Data.ClientSecret)
|
||||
}
|
||||
|
||||
if r.Data.ClientAssertionType == oidc.ClientAssertionTypeJWTAssertion {
|
||||
jwtExchanger, ok := s.provider.(JWTAuthorizationGrantExchanger)
|
||||
if !ok || !s.provider.AuthMethodPrivateKeyJWTSupported() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue