Auth: Fallback to default client authentication setting in AzureAD OAuth (#98798)

Fallback to default client authentication setting for backwards compatibility
pull/98774/head
Misi 4 months ago committed by GitHub
parent 0501ff9079
commit de290cf6a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      pkg/login/social/connectors/azuread_oauth.go
  2. 7
      public/app/features/auth-config/FieldRenderer.tsx
  3. 3
      public/app/features/auth-config/utils/data.ts

@ -198,9 +198,8 @@ func (s *SocialAzureAD) Exchange(ctx context.Context, code string, authOptions .
case social.ClientSecretPost:
// Default behavior for ClientSecretPost, no additional setup needed
default:
return nil, fmt.Errorf("invalid client authentication method: %s", s.info.ClientAuthentication)
s.log.Debug("ClientAuthentication is not set. Using default client authentication method")
}
// Default token exchange

@ -42,6 +42,13 @@ export const FieldRenderer = ({
}
}, [unregister, name, parentValue, isDependantField]);
useEffect(() => {
if (fieldData.defaultValue) {
setValue(name, fieldData.defaultValue.value);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
if (!field) {
console.log('missing field:', name);
return null;

@ -15,8 +15,11 @@ export const emptySettings: SSOProviderDTO = {
authStyle: '',
authUrl: '',
autoLogin: false,
clientAuthentication: '',
clientId: '',
clientSecret: '',
managedIdentityClientId: '',
federatedCredentialAudience: '',
emailAttributeName: '',
emailAttributePath: '',
emptyScopes: false,

Loading…
Cancel
Save