OAuth: Fix forwarding id token to the data source (#43204)

This commit is contained in:
Alexander Zobnin
2021-12-17 11:34:16 +03:00
committed by GitHub
parent bba7bdeb9e
commit 2c0f961c59

View File

@@ -127,6 +127,11 @@ func (s *Service) handleQueryData(ctx context.Context, user *models.SignedInUser
if s.oAuthTokenService.IsOAuthPassThruEnabled(ds) {
if token := s.oAuthTokenService.GetCurrentOAuthToken(ctx, user); token != nil {
req.Headers["Authorization"] = fmt.Sprintf("%s %s", token.Type(), token.AccessToken)
idToken, ok := token.Extra("id_token").(string)
if ok && idToken != "" {
req.Headers["X-ID-Token"] = idToken
}
}
}