4 Commits

Author SHA1 Message Date
codej99
0b296131ff Merge branch 'master' into feature/readme.md 2019-04-18 15:25:07 +09:00
kimyonghwa
62c14bb3bc Update README.md 2019-04-18 15:23:57 +09:00
codej99
9da74a4d13 Merge pull request #6 from codej99/feature/junit-test
Feature/junit test
2019-04-18 15:22:11 +09:00
kimyonghwa
16ae0132d2 modify security matcher path 2019-04-17 19:26:52 +09:00
3 changed files with 9 additions and 4 deletions

View File

@@ -62,4 +62,9 @@
- Document
- https://daddyprogrammer.org/post/636/springboot2-springsecurity-authentication-authorization/
- Git
- https://github.com/codej99/SpringRestApi/tree/feature/security
- https://github.com/codej99/SpringRestApi/tree/feature/security
- SpringBoot2로 Rest api 만들기(9) Unit Test
- Document
- https://daddyprogrammer.org/post/938/springboot2-restapi-unit-test/
- Git
- https://github.com/codej99/SpringRestApi/tree/feature/junit-test

View File

@@ -32,7 +32,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.and()
.authorizeRequests() // 다음 리퀘스트에 대한 사용권한 체크
.antMatchers("/*/signin", "/*/signup").permitAll() // 가입 및 인증 주소는 누구나 접근가능
.antMatchers(HttpMethod.GET, "/helloworld/**", "/favicon.ico").permitAll() // 등록한 GET요청 리소스는 누구나 접근가능
.antMatchers(HttpMethod.GET, "/helloworld/**").permitAll() // hellowworld로 시작하는 GET요청 리소스는 누구나 접근가능
.anyRequest().hasRole("USER") // 그외 나머지 요청은 모두 인증된 회원만 접근 가능
.and()
.exceptionHandling().accessDeniedHandler(new CustomAccessDeniedHandler())

View File

@@ -13,7 +13,7 @@ public class HelloController {
@Setter
@Getter
private static class Hello {
public static class Hello {
private String message;
}
@@ -33,6 +33,6 @@ public class HelloController {
@GetMapping(value = "/helloworld/page")
public String helloworld() {
return "helloworld";
return HELLO;
}
}