Skip to content

Commit

Permalink
FIX: grant type key
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremiahUy committed Dec 2, 2024
1 parent e287f77 commit ee15b05
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ private void updateToken(String scope) {
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
headers.setBasicAuth(clientId, clientSecret);


var response = restTemplate.exchange(azureAdTokenEndpoint, HttpMethod.POST, new HttpEntity<>(formParameters, headers), AccessTokenResponse.class);

if (response.getBody() != null) {
Expand All @@ -95,7 +94,7 @@ private void updateToken(String scope) {

private MultiValueMap<String, String> formParameters(String scope) {
MultiValueMap<String, String> formParameters = new LinkedMultiValueMap<>();
formParameters.add("grant_type", "client_credentials");
formParameters.add("grant-type", "client_credentials");
formParameters.add("scope", scope);

return formParameters;
Expand Down

0 comments on commit ee15b05

Please sign in to comment.