Skip to content

Commit

Permalink
Merge pull request #314 from xetys/fix-313
Browse files Browse the repository at this point in the history
use tokenServiceId from JHipster properties...
  • Loading branch information
jdubois committed Nov 22, 2018
2 parents 88a375b + bebfdd2 commit 00db366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -63,7 +63,8 @@ private void retrieveNewAccessToken() {
map.add("grant_type", "client_credentials");

HttpEntity<?> requestEntity = new HttpEntity<>(map, headers);
ResponseEntity<DefaultOAuth2AccessToken> responseEntity = this.restTemplate.exchange("http://UAA/oauth/token", HttpMethod.POST, requestEntity, DefaultOAuth2AccessToken.class);
String uaaServiceId = jHipsterProperties.getSecurity().getClientAuthorization().getTokenServiceId();
ResponseEntity<DefaultOAuth2AccessToken> responseEntity = this.restTemplate.exchange("http://" + uaaServiceId + "/oauth/token", HttpMethod.POST, requestEntity, DefaultOAuth2AccessToken.class);

if (!responseEntity.getStatusCode().is2xxSuccessful()) {
//TODO
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config/application-uaa.yaml
@@ -1,9 +1,10 @@
jhipster:
security:
client-authorization:
token-service-id: uaa
client-id: internal
client-secret: internal

eureka:
client:
fetch-registry: true
fetch-registry: true

0 comments on commit 00db366

Please sign in to comment.