Skip to content

Commit

Permalink
FIX: bean name
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremiahUy committed Nov 29, 2024
1 parent 9e65a95 commit d9225f2
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Builder;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import no.nav.data.common.exceptions.TokenExpiredException;
import no.nav.data.common.security.dto.AccessTokenResponse;
Expand All @@ -26,13 +27,10 @@

@Slf4j
@Component
@RequiredArgsConstructor
public class AzureTokenConsumer {

private final RestTemplate azureRestClient;

public AzureTokenConsumer(RestTemplate azureRestClient) {
this.azureRestClient = azureRestClient;
}
private final RestTemplate restTemplate;

@Value("${azure.activedirectory.client-id}")
private String clientId;
Expand Down Expand Up @@ -84,7 +82,7 @@ private void updateToken(String scope) {
headers.setBasicAuth(clientId, clientSecret);


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

if (response.getBody() != null) {
var token = Token.builder()
Expand Down

0 comments on commit d9225f2

Please sign in to comment.