3
0
mirror of https://github.com/grafana/grafana.git synced 2025-02-25 18:55:37 -06:00

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

Hide Forward OAuth Identity toggle when azure auth is enabled
This commit is contained in:
ismail simsek 2023-07-18 10:40:57 +03:00 committed by GitHub
parent b089281255
commit 31d3f7fd83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>