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} /> )}