From e6632c71a03ae45527578b718566bc92be286316 Mon Sep 17 00:00:00 2001 From: DOHA Date: Fri, 11 Jan 2019 14:12:11 +0200 Subject: [PATCH] minor fix --- .../{FooController.java => FooClientController.java} | 6 +++--- .../src/main/resources/application.yml | 6 +++--- .../src/main/resources/application.properties | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/{FooController.java => FooClientController.java} (86%) diff --git a/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/FooController.java b/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/FooClientController.java similarity index 86% rename from clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/FooController.java rename to clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/FooClientController.java index 405bbaf23..5b081c29e 100644 --- a/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/FooController.java +++ b/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/java/com/baeldung/oauth/web/controller/FooClientController.java @@ -11,21 +11,21 @@ import com.baeldung.oauth.web.dto.Foo; @Controller -public class FooController { +public class FooClientController { @Autowired private RestTemplate restTemplate; @GetMapping("/foos/{id}") public String getFooResource(@PathVariable long id, Model model) { - Foo foo = restTemplate.getForEntity("http://localhost:8088/spring-security-oauth-resource/foos/" + id, Foo.class).getBody(); + Foo foo = restTemplate.getForEntity("http://localhost:8082/spring-security-oauth-resource/foos/" + id, Foo.class).getBody(); model.addAttribute("foo", foo); return "foo"; } @PostMapping("/foos") public String addNewFoo(Foo foo, Model model) { - Foo created = restTemplate.postForEntity("http://localhost:8088/spring-security-oauth-resource/foos/", foo, Foo.class).getBody(); + Foo created = restTemplate.postForEntity("http://localhost:8082/spring-security-oauth-resource/foos/", foo, Foo.class).getBody(); model.addAttribute("foo", created); return "foo"; } diff --git a/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/resources/application.yml b/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/resources/application.yml index 95354a2dc..3d3b2b0a6 100644 --- a/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/resources/application.yml +++ b/clients-thymeleaf/oauth-ui-authorization-code-thymeleaf/src/main/resources/application.yml @@ -6,12 +6,12 @@ spring: custom: client-id: fooClientIdPassword client-secret: secret - scopes: read,foo + scope: read,write,foo authorization-grant-type: authorization_code - redirect-uri-template: http://localhost:8080/login/oauth2/code/custom + redirect-uri: http://localhost:8080/login/oauth2/code/custom provider: custom: authorization-uri: http://localhost:8081/spring-security-oauth-server/oauth/authorize token-uri: http://localhost:8081/spring-security-oauth-server/oauth/token - user-info-uri: http://localhost:8088/spring-security-oauth-resource/users/extra + user-info-uri: http://localhost:8082/spring-security-oauth-resource/users/extra user-name-attribute: user_name \ No newline at end of file diff --git a/oauth-resource-server-2/src/main/resources/application.properties b/oauth-resource-server-2/src/main/resources/application.properties index 42c15d485..4b94bd431 100644 --- a/oauth-resource-server-2/src/main/resources/application.properties +++ b/oauth-resource-server-2/src/main/resources/application.properties @@ -1,4 +1,4 @@ -server.servlet.contextPath=/spring-security-oauth-resource +server.servlet.context-path=/spring-security-oauth-resource server.port=8088 logging.level.org=INFO #endpoints.cors.allowed-origins=* \ No newline at end of file