Skip to content

Commit

Permalink
Merge pull request #54 from envoy/manuenvoy/new_login_functions
Browse files Browse the repository at this point in the history
feat(login): Add scopes parameter to the `loginAsPlugin` function
  • Loading branch information
manuenvoy authored Apr 9, 2024
2 parents cb4e3af + ab304f8 commit cb4cb05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdk/EnvoyPluginAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<EnvoyMetaAuth> {
static async loginAsPlugin(id = envoyClientId, secret = envoyClientSecret, scope: string[] = ['plugin', 'token.refresh']): Promise<EnvoyMetaAuth> {
try {
const { data } = await axios({
auth: {
Expand All @@ -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,
Expand Down

0 comments on commit cb4cb05

Please sign in to comment.