Spring Security Interview Questions
Spring Security Interview Questions
The role of the user is used to determine which user is authorized to access the
resource.
A security measure applied to a method prevent unauthorized users and only
allow authenticate users.
To prevent unauthorized users from performing activities beyond their privileges
and roles.
Method level security is implemented using AOP.
13) Can you add custom filter in spring security filter chain?
Yes, you can add or replace individual filter with own logic in spring security
filter chai.
You may need to implement new functionality depending upon your project
requirement and this can be done by creating new filter to use in the chain.
We do use filter type like OncePerRequestFilter and register with security
configuration.
18) Which servlet filter, intercepts all the incoming request sent to an application?
Filter implementation named Delegatingfilterproxy that allow bridging between
the servlet containers life cycle and spring ApplicationContext.
The servlet container allow registering filters using its own standard.
Delegatingfilterproxy can be registered via standard servlet container
mechanism.
19) To Secured which layer @EnableGlobalMethodSecurity annotation is used?
We can use @EnableGlobalMethodSecurity annotation to secure your service
layer.
It provides supports for JSR-250 annotation security as well ass the framework
original @secured annotation.
From 3.0 you can also make use of new expression-based annotations.