Skip to content

Commit

Permalink
yes tired sry
Browse files Browse the repository at this point in the history
  • Loading branch information
hknots committed Nov 29, 2024
1 parent fe06098 commit 680f833
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/main/java/no/fint/oauth/TokenInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@

@Slf4j
@Component
@RequiredArgsConstructor
@ConditionalOnProperty(value = "fint.oauth.enabled", havingValue = "true")
public class TokenInstance {

private final MultiValueMap<String, String> formData = createFormData();
private final RestClient oauthRestClient;
private final OAuthTokenProps props;
private final MultiValueMap<String, String> formData;
private AuthToken authToken;

public TokenInstance(OAuthTokenProps props, RestClient oauthRestClient) {
this.props = props;
this.oauthRestClient = oauthRestClient;
this.formData = createFormData();
}

@PostConstruct
public void init() {
if (ObjectUtils.isEmpty(props.getAccessTokenUri())) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/no/fint/oauth/TokenService.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void init() {
}

private void refreshConnection(String requestUrl) {
ResponseEntity<Void> response = oauthRestClient.post()
ResponseEntity<Void> response = oauthRestClient.get()
.uri(requestUrl)
.headers(header -> header.add(
HttpHeaders.AUTHORIZATION, BEARER_TOKEN_TEMPLATE.formatted(tokenInstance.getAccessToken())
Expand Down

0 comments on commit 680f833

Please sign in to comment.