- Authorization authorization = subject
- .getPrivateCredentials(Authorization.class).iterator().next();
- if (request != null && authorization.getName() != null) {
- request.setAttribute(HttpContext.REMOTE_USER,
- authorization.getName());
- request.setAttribute(HttpContext.AUTHORIZATION, authorization);
- request.getSession().setAttribute(HttpContext.AUTHORIZATION,
- authorization);
- subject.getPrivateCredentials().add(request.getSession());
- }