From ab304f82e2a1b1427e4c69441925684c5e98ee03 Mon Sep 17 00:00:00 2001 From: Manu Singh Date: Tue, 9 Apr 2024 12:02:39 -0700 Subject: [PATCH] add scope --- src/sdk/EnvoyPluginAPI.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdk/EnvoyPluginAPI.ts b/src/sdk/EnvoyPluginAPI.ts index aa14adc..951e93d 100644 --- a/src/sdk/EnvoyPluginAPI.ts +++ b/src/sdk/EnvoyPluginAPI.ts @@ -70,7 +70,7 @@ export default class EnvoyPluginAPI extends EnvoyAPI { /** * Gets a plugin access token using `client_credentials` as the grant type. */ - static async loginAsPlugin(id = envoyClientId, secret = envoyClientSecret): Promise { + static async loginAsPlugin(id = envoyClientId, secret = envoyClientSecret, scope: string[] = ['plugin', 'token.refresh']): Promise { try { const { data } = await axios({ auth: { @@ -82,7 +82,7 @@ export default class EnvoyPluginAPI extends EnvoyAPI { grant_type: 'client_credentials', client_id: id, client_secret: secret, - scope: 'plugin,token.refresh', + scope: scope.join(','), }, url: '/a/auth/v0/token', baseURL: envoyBaseURL,