Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Doha2012 committed Jan 11, 2019
1 parent 3fad099 commit e6632c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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=*

0 comments on commit e6632c7

Please sign in to comment.