Skip to content

Commit

Permalink
fix: use correct content type for token request (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh authored Feb 12, 2024
2 parents 217bfc6 + 7e1dcdd commit 8741983
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions credentials/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ export class Credentials {
client_secret: clientCredentials.clientSecret,
audience: clientCredentials.apiAudience,
grant_type: "client_credentials",
},
headers: {
"Content-Type": "application/x-www-form-urlencoded"
}
}, {
maxRetry: 3,
Expand Down
10 changes: 6 additions & 4 deletions tests/helpers/nocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ export const getNocks = ((nock: typeof Nock) => ({
expiresIn = 300,
statusCode = 200,
) => {
return nock(`https://${apiTokenIssuer}`).post("/oauth/token").reply(statusCode, {
access_token: accessToken,
expires_in: expiresIn,
});
return nock(`https://${apiTokenIssuer}`, { reqheaders: { "Content-Type": "application/x-www-form-urlencoded"} })
.post("/oauth/token")
.reply(statusCode, {
access_token: accessToken,
expires_in: expiresIn,
});
},
listStores: (
basePath = defaultConfiguration.getBasePath(),
Expand Down

0 comments on commit 8741983

Please sign in to comment.