Search in sources :

Example 1 with HttpServletRequestWithPrincipal

use of org.simbasecurity.client.filter.request.HttpServletRequestWithPrincipal in project simba-os by cegeka.

the class DoFilterAndSetPrincipalAction method execute.

@Override
public void execute() throws ServletException, IOException {
    String username = getActionDescriptor().getPrincipal();
    Principal principal = null;
    if (username != null) {
        principal = new UserPrincipal(username);
    }
    if (principal != null) {
        request = new HttpServletRequestWithPrincipal(request, principal);
    }
    if (doFilterExtension != null)
        doFilterExtension.before();
    try {
        filterChain.doFilter(request, response);
    } finally {
        if (doFilterExtension != null)
            doFilterExtension.after();
    }
}
Also used : HttpServletRequestWithPrincipal(org.simbasecurity.client.filter.request.HttpServletRequestWithPrincipal) Principal(java.security.Principal) HttpServletRequestWithPrincipal(org.simbasecurity.client.filter.request.HttpServletRequestWithPrincipal) UserPrincipal(com.sun.security.auth.UserPrincipal) UserPrincipal(com.sun.security.auth.UserPrincipal)

Aggregations

UserPrincipal (com.sun.security.auth.UserPrincipal)1 Principal (java.security.Principal)1 HttpServletRequestWithPrincipal (org.simbasecurity.client.filter.request.HttpServletRequestWithPrincipal)1