Skip to content

Commit 75deed6

Browse files
committed
fix merge mistake, use passed-in tokenSource
1 parent 3d02adb commit 75deed6

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

path_oidc.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (b *jwtAuthBackend) pathCallback(ctx context.Context, req *logical.Request,
289289
}
290290

291291
// Verify the ID token received from the authentication response.
292-
rawToken = oidc.IDToken(oidcReq.idToken)
292+
rawToken := oidc.IDToken(oidcReq.idToken)
293293
if _, err := provider.VerifyIDToken(ctx, rawToken, oidcReq); err != nil {
294294
return logical.ErrorResponse("%s %s", errTokenVerification, err.Error()), nil
295295
}
@@ -352,15 +352,7 @@ func (b *jwtAuthBackend) processToken(ctx context.Context, config *jwtConfig, oi
352352
return loginFailedResponse(useHttp, "sub claim does not match bound subject"), nil
353353
}
354354

355-
// Set the token source for the access token if it's available. It will only
356-
// be available for the authorization code flow (oidc_response_types=code).
357-
// The access token will be used for fetching additional user and group info.
358-
var tokenSource oauth2.TokenSource
359-
if token != nil {
360-
tokenSource = token.StaticTokenSource()
361-
}
362-
363-
// If we have a token, attempt to fetch information from the /userinfo endpoint
355+
// If we have a tokenSource, attempt to fetch information from the /userinfo endpoint
364356
// and merge it with the existing claims data. A failure to fetch additional information
365357
// from this endpoint will not invalidate the authorization flow.
366358
if tokenSource != nil {

0 commit comments

Comments
 (0)