feat(op): add support for client credentials
This commit is contained in:
parent
2574ebc6e7
commit
90b99d4d2b
8 changed files with 145 additions and 2 deletions
|
@ -18,6 +18,7 @@ type Exchanger interface {
|
|||
GrantTypeRefreshTokenSupported() bool
|
||||
GrantTypeTokenExchangeSupported() bool
|
||||
GrantTypeJWTAuthorizationSupported() bool
|
||||
GrantTypeClientCredentialsSupported() bool
|
||||
}
|
||||
|
||||
func tokenHandler(exchanger Exchanger) func(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -42,6 +43,11 @@ func tokenHandler(exchanger Exchanger) func(w http.ResponseWriter, r *http.Reque
|
|||
TokenExchange(w, r, exchanger)
|
||||
return
|
||||
}
|
||||
case string(oidc.GrantTypeClientCredentials):
|
||||
if exchanger.GrantTypeClientCredentialsSupported() {
|
||||
ClientCredentialsExchange(w, r, exchanger)
|
||||
return
|
||||
}
|
||||
case "":
|
||||
RequestError(w, r, oidc.ErrInvalidRequest().WithDescription("grant_type missing"))
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue