Skip to content

Commit

Permalink
Fix device flow missing openid scope
Browse files Browse the repository at this point in the history
The openid scope is required for the userinfo endpoint to work.
  • Loading branch information
tsipinakis committed Jan 31, 2024
1 parent 1159c53 commit 2c74d26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/auth/oauth2_oidc_flow_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
type oidcDeviceRequest struct {
ClientID string `schema:"client_id"`
GrantType string `schema:"grant_type"`
Scope string `schema:"scope"`
}

type oidcDeviceResponse struct {
Expand Down Expand Up @@ -43,6 +44,8 @@ func (o *oidcDeviceFlow) GetAuthorizationURL(ctx context.Context) (
req := &oidcDeviceRequest{
ClientID: o.provider.clientID,
GrantType: "urn:ietf:params:oauth:grant-type:device_code",
// openid scope is required to access the userinfo endpoint
Scope: "openid",
}
var lastError error
var statusCode int
Expand Down

0 comments on commit 2c74d26

Please sign in to comment.