From 31d3f7fd83f76a264a9623932e3188a54a689fd3 Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Tue, 18 Jul 2023 10:40:57 +0300 Subject: [PATCH] Fix: Hide Forward OAuth Identity toggle when azure auth is enabled (#71640) Hide Forward OAuth Identity toggle when azure auth is enabled --- .../DataSourceSettings/DataSourceHttpSettings.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx index c6516dca493..03c902a3880 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/DataSourceHttpSettings.tsx @@ -148,6 +148,12 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => { const azureAuthEnabled: boolean = (azureAuthSettings?.azureAuthSupported && azureAuthSettings.getAzureAuthEnabled(dataSourceConfig)) || false; + // Azure Authentication doesn't work correctly when Forward OAuth Identity is enabled. + // The Authorization header that has been set by the ApplyAzureAuth middleware gets overwritten + // with the Authorization header set by the OAuthTokenMiddleware. + dataSourceConfig.jsonData.oauthPassThru = azureAuthEnabled ? false : dataSourceConfig.jsonData.oauthPassThru; + const shouldShowForwardOAuthIdentityOption = azureAuthEnabled ? false : showForwardOAuthIdentityOption; + return (
<> @@ -295,7 +301,7 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => { onSettingsChange({ jsonData })} - showForwardOAuthIdentityOption={showForwardOAuthIdentityOption} + showForwardOAuthIdentityOption={shouldShowForwardOAuthIdentityOption} /> )}