feat: Add support for client credentials with Azure Log monitor (#13038)

This commit is contained in:
Jon 2025-02-05 08:51:09 +00:00 committed by GitHub
parent 21773764d3
commit 2c2d63157b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,7 @@ export class MicrosoftAzureMonitorOAuth2Api implements ICredentialType {
displayName = 'Microsoft Azure Monitor OAuth2 API';
extends = ['microsoftOAuth2Api'];
extends = ['oAuth2Api'];
documentationUrl = 'microsoftazuremonitor';
@ -18,6 +18,22 @@ export class MicrosoftAzureMonitorOAuth2Api implements ICredentialType {
};
properties: INodeProperties[] = [
{
displayName: 'Grant Type',
name: 'grantType',
type: 'options',
options: [
{
name: 'Authorization Code',
value: 'authorizationCode',
},
{
name: 'Client Credentials',
value: 'clientCredentials',
},
],
default: 'authorizationCode',
},
{
displayName: 'Tenant ID',
required: true,
@ -59,19 +75,28 @@ export class MicrosoftAzureMonitorOAuth2Api implements ICredentialType {
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: '=https://login.microsoftonline.com/{{$self["tenantId"]}}/oauth2/token',
default:
'=https://login.microsoftonline.com/{{$self["tenantId"]}}/oauth2/{{$self["grantType"] === "clientCredentials" ? "v2.0/" : ""}}token',
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden',
default: '=resource={{$self["resource"]}}',
default:
'={{$self["grantType"] === "clientCredentials" ? "" : "resource=" + $self["resource"]}}',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: '',
default:
'={{$self["grantType"] === "clientCredentials" ? $self["resource"] + "/.default" : ""}}',
},
{
displayName: 'Authentication',
name: 'authentication',
type: 'hidden',
default: 'body',
},
];
}