안녕하세요. 봄부터 액세스가 거부되었습니다. 누군가가 내가 봄 4.3스프링 보안이 올바른 자격 증명 403을 제공합니다.
당신은 사용자가 두 개의 기관을 가지고 있음을 알 수 아래 로그에서와 마찬가지로 내 컨트롤러
@RestController
@RequestMapping (value = "/api/secured/resource/school")
@Secured ({ ApplicationConstants.Role.SYSTEM_ADMIN, ApplicationConstants.Role.SCHOOL_ADMIN })
public class SchoolController
{
@Autowired
private SchoolService schoolService;
@PostMapping (consumes = "application/json")
@Secured ({ ApplicationConstants.Role.SYSTEM_ADMIN })
public @ResponseBody ResponsePayload createSchool (HttpServletRequest request, @RequestBody School school)
throws ServiceException
{
}
interface Role
{
String SYSTEM_ADMIN = "SYSTEM_ADMIN";
String SCHOOL_ADMIN = "SCHOOL_ADMIN";
}
를 사용하고이
좀 도와 주시겠습니까
SYSTEM_USER, SYSTEM_ADMIN 여전히 나에게 접근 거부를 제공합니다.
Sprin g 구성
<http pattern="/static/**" security="none" />
<http use-expressions="true">
<intercept-url pattern="/app/**" access="isAuthenticated()" />
<form-login login-page="/loginPage"
authentication-success-handler-ref="mySuccessHandler"
authentication-failure-handler-ref="myFailureHandler" />
<logout logout-success-url="/loginPage" />
<custom-filter ref="loginFilter" after="FIRST" />
<csrf disabled="true" />
</http>
2016년 7월 15일 16 : 03 : 12,525 디버그의 MethodSecurityInterceptor : 348 - 이전에 인증 : org.springframew[email protected]7670236f : 주 : SystemUser [userId를 = 1, = 관리자 이름 , email = [email protected], mobilePhone = 9999999999, status = ACTIVE]; 자격증 명 : [PROTECTED]; 인증 됨 : true; 세부 사항 : org.sprin[email protected]0 : RemoteIpAddress : 0 : 0 : 0 : 0 : 0 : 0 : 0 : 1; SessionId : 1h5x6yxtd1m0y1ogs4h5vfo1yl; 수여 기관 : SYSTEM_USER, 시스템 _ 2016년 7월 15일 16 : 03 : 12,525 DEBUG는 AffirmativeBased : 66 - 유권자 : [email protected]를 반환 : 0 2016년 7월 15일 (16) : 03 : 12,527 DEBUG AffirmativeBased : 66 - 유권자 : [email protected]4efc, 반환 된 : 0 2016-07-15 16 : 03 : 12,529 DEBUG ExceptionHandlerExceptionResolver : 133 - 핸들러에서 예외 처리 중 [public com.tepachi.web.response.ResponsePayload com.tepachi.web.controller.SchoolController.createSchool (javax.servlet.http.HttpServletRequest, com.tepachi.db.entities.user.School) throws com.tepachi.exception.ServiceException] : org.springframework.security.access.AccessDeniedException : 액세스가 거부되었습니다.