I'm using Spring Security 4.1.0 for security of my java web application. I use @PostAuthorize
annotation for get
method as follow:
Interface:
@PreAuthorize("hasAuthority('get')")
@PostAuthorize("hasPermission(returnObject, 'read')")
MyEntity get(Serializable id);
And get
implemntation method is as follow:
@Override
@Transactional
public MyEntity get(Serializable id)
{
MyEntity record = dao.get(id);
System.out.println(record.getId() + " : " + record.getName());
return record;
}
In web.xml
I set sessionConfig as follow:
<session-config>
<session-timeout> 10 </session-timeout>
</session-config>
User login to application and call get
method. User don't send a request to server in 3 minutes later. He send another request to cal get
method. response is 403 Access Denied
, After this User send another same request Immediately, But response is 200 OK
. See this Requests:
403
Response:
Tomcat console logs in 2 case as follow:
538 : MyEntity 2
Whats the problem?
Is it a spring security
bug?