Home > FAQs > How do I obtain security details (JAAS) |
You can obtain the UserPrincipal and other security details by going through the request or implementing PrincipalAware. Implementing PrincipalAware is preferred.
First obtain the HttpServletRequest and then obtain the security Principal.
Preferred
servlet-config
Interceptor is included in the Action's stack.
servlet-config
.setPrincipalProxy(PrincipalProxy)
method. You may wish to include a companion getPrincipalProxy
method.isUserInRole
, getUserPrincipal()
, getRemoteUser()
, isRequestSecure()
, and so forth.@see org.apache.struts.action2.interceptor.PrincipalProxy
@see org.apache.struts.action2.interceptor.PrincipalAware
@see org.apache.struts.action2.interceptor.ServletConfigInterceptor