fix: Only set GrantType once (#353) (#367)

This fixes an issue where, when using the device authorization flow, the
grant type would be set twice. Some OPs don't accept this, and fail when
polling.

With this fix the grant type is only set once, which will make some OPs
happy again.

Fixes #352
This commit is contained in:
Thomas Hipp 2023-04-13 15:04:58 +02:00 committed by GitHub
parent c778e8329c
commit 312c2a07e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View file

@ -12,7 +12,6 @@ import (
func newDeviceClientCredentialsRequest(scopes []string, rp RelyingParty) (*oidc.ClientCredentialsRequest, error) {
confg := rp.OAuthConfig()
req := &oidc.ClientCredentialsRequest{
GrantType: oidc.GrantTypeDeviceCode,
Scope: scopes,
ClientID: confg.ClientID,
ClientSecret: confg.ClientSecret,

View file

@ -241,7 +241,7 @@ type TokenExchangeRequest struct {
}
type ClientCredentialsRequest struct {
GrantType GrantType `schema:"grant_type"`
GrantType GrantType `schema:"grant_type,omitempty"`
Scope SpaceDelimitedArray `schema:"scope"`
ClientID string `schema:"client_id"`
ClientSecret string `schema:"client_secret"`