mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
fix(tokenExchange): use correct token type for userInfo requests (#3336)
Signed-off-by: Chris H <33393789+MrDeerly@users.noreply.github.com>
This commit is contained in:
@@ -433,7 +433,10 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
|
||||
// We immediately want to run getUserInfo if configured before we validate the claims.
|
||||
// For token exchanges with access tokens, this is how we verify the token.
|
||||
if c.getUserInfo {
|
||||
userInfo, err := c.provider.UserInfo(ctx, oauth2.StaticTokenSource(token))
|
||||
userInfo, err := c.provider.UserInfo(ctx, oauth2.StaticTokenSource(&oauth2.Token{
|
||||
AccessToken: token.AccessToken,
|
||||
TokenType: "Bearer", // The UserInfo endpoint requires a bearer token as per RFC6750
|
||||
}))
|
||||
if err != nil {
|
||||
return identity, fmt.Errorf("oidc: error loading userinfo: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user