Skip to content

Commit

Permalink
further
Browse files Browse the repository at this point in the history
  • Loading branch information
wood-push-melon committed Apr 12, 2024
1 parent c308b3d commit 539578b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions handler/openid/flow_device_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package openid

import (
"context"
"fmt"

"github.com/ory/fosite/handler/rfc8628"

Expand All @@ -30,7 +29,6 @@ func (c *OpenIDConnectDeviceHandler) HandleDeviceEndpointRequest(ctx context.Con
return errorsx.WithStack(fosite.ErrInvalidScope.WithDebug("invalid openid scopes"))
}

fmt.Printf("in openid auth handler")
if !dar.GetClient().GetGrantTypes().Has(string(fosite.GrantTypeDeviceCode)) {
return errorsx.WithStack(fosite.ErrInvalidGrant.WithDebug("invalid device flow grant type"))
}
Expand Down
9 changes: 5 additions & 4 deletions handler/openid/flow_device_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ func (c *OpenIDConnectDeviceHandler) PopulateTokenEndpointResponse(ctx context.C
}

if !ar.GetGrantedScopes().Has("openid") {
return errorsx.WithStack(
// fosite.ErrMisconfiguration.WithDebug("An OpenID Connect session was found but the openid scope is missing, probably due to a broken code configuration.")
fosite.ErrMisconfiguration.WithDebugf("An OpenID Connect granted scopes: %v", ar.GetGrantedScopes()),
)
//return errorsx.WithStack(
// fosite.ErrMisconfiguration.WithDebug("An OpenID Connect session was found but the openid scope is missing, probably due to a broken code configuration.")
// fosite.ErrMisconfiguration.WithDebugf("An OpenID Connect granted scopes: %v", ar.GetGrantedScopes()),
//)
return nil
}

if !requester.GetClient().GetGrantTypes().Has(string(fosite.GrantTypeDeviceCode)) {
Expand Down

0 comments on commit 539578b

Please sign in to comment.