Skip to content

Commit

Permalink
fix(oauth): uri encode clientId and clientSecret
Browse files Browse the repository at this point in the history
clientId and clientSecret containing special characters are correctly handled

fixes #230
  • Loading branch information
jwulf committed Aug 21, 2024
1 parent d1ec5b5 commit dd8583a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/oauth/lib/OAuthProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ export class OAuthProvider implements IOAuthProvider {
}) {
const body = `${this.addAudienceIfNeeded(
audienceType
)}client_id=${clientIdToUse}&client_secret=${clientSecretToUse}&grant_type=client_credentials`
)}client_id=${encodeURIComponent(
clientIdToUse
)}&client_secret=${encodeURIComponent(
clientSecretToUse
)}&grant_type=client_credentials`
/* Add a scope to the token request, if one is set */
const bodyWithScope = this.scope ? `${body}&scope=${this.scope}` : body

Expand Down

0 comments on commit dd8583a

Please sign in to comment.