From 843e587a05f4e80bc1e27fcbccc8e1afc5cfe3fc Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Tue, 1 Mar 2022 18:49:58 +0100 Subject: [PATCH] Docs: Fix typo in Forward OAuth identity for the logged-in user section (#46043) Fixes #45938 --- ...dd-authentication-for-data-source-plugins.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/sources/developers/plugins/add-authentication-for-data-source-plugins.md b/docs/sources/developers/plugins/add-authentication-for-data-source-plugins.md index bb0b333e998..c4a8e4e0bda 100644 --- a/docs/sources/developers/plugins/add-authentication-for-data-source-plugins.md +++ b/docs/sources/developers/plugins/add-authentication-for-data-source-plugins.md @@ -291,16 +291,15 @@ When configured, Grafana will pass the user's token to the plugin in an Authoriz ```go func (ds *dataSource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) { - for _, q := range req.Queries { - token := strings.Fields(q.Headers.Get("Authorization")) + token := strings.Fields(req.Headers["Authorization"]) + var ( + tokenType = token[0] + accessToken = token[1] + ) - var ( - tokenType = token[0] - accessToken = token[1] - ) - - // ... - } + for _, q := range req.Queries { + // ... + } } ```