Skip to content

Commit

Permalink
Completes the support for oauth2 scopes (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvmw authored Mar 9, 2023
1 parent 4c49301 commit aa5e068
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public ConfigServicePropertySourceLocator configServicePropertySourceLocator(
ClientRegistration clientRegistration = ClientRegistration.withRegistrationId("config-client")
.clientId(configClientOAuth2Properties.getClientId())
.clientSecret(configClientOAuth2Properties.getClientSecret())
.scope(configClientOAuth2Properties.getScope())
.tokenUri(configClientOAuth2Properties.getAccessTokenUri())
.authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS).build();
RestTemplate restTemplate = new RestTemplate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public VaultTokenRefresher vaultTokenRefresher(ConfigClientProperties configClie
.authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS)
.clientId(configClientOAuth2Properties.getClientId())
.clientSecret(configClientOAuth2Properties.getClientSecret())
.scope(configClientOAuth2Properties.getScope())
.tokenUri(configClientOAuth2Properties.getAccessTokenUri()).build();
restTemplate.getInterceptors().add(new OAuth2AuthorizedClientHttpRequestInterceptor(clientRegistration));
String obscuredToken = vaultToken.substring(0, 4) + "[*]" + vaultToken.substring(vaultToken.length() - 4);
Expand Down

0 comments on commit aa5e068

Please sign in to comment.