public class ClampServlet extends CamelHttpTransportServlet {
/**
- *
+ * The serial version ID.
*/
private static final long serialVersionUID = -4198841134910211542L;
@Override
protected void doService(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
- Principal p = request.getUserPrincipal();
- if (loadDynamicAuthenticationClass().isInstance(p)) {
+ Principal principal = request.getUserPrincipal();
+ if (loadDynamicAuthenticationClass().isInstance(principal)) {
// When AAF is enabled, there is a need to provision the permissions to Spring
// system
List<GrantedAuthority> grantedAuths = new ArrayList<>();
grantedAuths.add(new SimpleGrantedAuthority(permString));
}
}
- Authentication auth = new UsernamePasswordAuthenticationToken(new User(p.getName(), "", grantedAuths), "",
+ Authentication auth = new UsernamePasswordAuthenticationToken(new User(principal.getName(), "", grantedAuths), "",
grantedAuths);
SecurityContextHolder.getContext().setAuthentication(auth);
}