Fix: Hide Forward OAuth Identity toggle when azure auth is enabled (#71640)

Hide Forward OAuth Identity toggle when azure auth is enabled
This commit is contained in:
ismail simsek
2023-07-18 09:40:57 +02:00
committed by GitHub
parent b089281255
commit 31d3f7fd83
@@ -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 (
<div className="gf-form-group">
<>
@@ -295,7 +301,7 @@ export const DataSourceHttpSettings = (props: HttpSettingsProps) => {
<HttpProxySettings
dataSourceConfig={dataSourceConfig}
onChange={(jsonData) => onSettingsChange({ jsonData })}
showForwardOAuthIdentityOption={showForwardOAuthIdentityOption}
showForwardOAuthIdentityOption={shouldShowForwardOAuthIdentityOption}
/>
)}
</div>