@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION)); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
public void cleanSubject(MessageInfo messageInfo, Subject subject) throws AuthException { Request request = (Request) messageInfo.getRequestMessage(); Principal principal = request.getUserPrincipal(); if(subject != null) subject.getPrincipals().remove(principal); }
public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
public java.security.Principal getUserPrincipal() { if (request == null) { throw MESSAGES.nullRequestFacade(); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public java.security.Principal getUserPrincipal() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } return request.getUserPrincipal(); }
@Override public void logout() throws ServletException { Realm realm = (context == null ? null : context.getRealm()); if (realm == null) { if (getUserPrincipal() != null || getAuthType() != null) { throw new ServletException( rb.getString(LogFacade.INTERNAL_LOGOUT_ERROR)); } return; } /* * Pass the request (this). */ realm.logout(this); }
private boolean validateRole(final String roleName, final RequestContext requestContext) { final long start = System.nanoTime(); final boolean userInRole = requestContext.getRequest().isUserInRole(roleName); RouteEventsLogger.evaluateRole(roleName, userInRole, start); String logMessage = null; if(userInRole){ logMessage = requestContext.getRequest().getUserPrincipal().getName() + " has the role '" + roleName + "'"; }else{ logMessage = requestContext.getRequest().getUserPrincipal().getName() + " doesn't have the role '" + roleName + "'"; } requestContext.getEventHandler().info("roles", logMessage); return userInRole; }
private boolean validateRoles(final RouteMetaData route, final RequestContext requestContext) { if (route.getRoles() == null || route.getRoles().isEmpty()) { return true; } if (requestContext.getRequest().getUserPrincipal() == null) { return false; } if (route.getRolesRequired().contains(RouteMetaData.Require.ANY)) { return route.getRoles().stream().anyMatch(role -> validateRole(role.getName(), requestContext)); } else { return route.getRoles().stream().allMatch(role -> validateRole(role.getName(), requestContext)); } }
/** * {@inheritDoc} */ @Override public void login(String username, String password) throws ServletException { if (getAuthType() != null || getRemoteUser() != null || getUserPrincipal() != null) { throw new ServletException( sm.getString("coyoteRequest.alreadyAuthenticated")); } getContext().getAuthenticator().login(username, password, this); }
public void invoke(Request request, Response response) throws IOException, ServletException { Principal user = request.getUserPrincipal(); if( user instanceof JBossGenericPrincipal ) { // Restore the actual principal to the request JBossGenericPrincipal guser = (JBossGenericPrincipal) user; Principal realUser = guser.getCallerPrincipal(); request.setUserPrincipal(realUser); } getNext().invoke(request, response); } }
/** * {@inheritDoc} */ @Override public void login(String username, String password) throws ServletException { if (getAuthType() != null || getRemoteUser() != null || getUserPrincipal() != null) { throw new ServletException( sm.getString("coyoteRequest.alreadyAuthenticated")); } getContext().getAuthenticator().login(username, password, this); }
/** {@inheritDoc} */ public final boolean authenticate(final Request request, final HttpServletResponse response, final LoginConfig loginConfig) throws IOException { Principal principal = request.getUserPrincipal(); boolean result = false; if (principal == null) { // Authentication sets the response headers for status and redirect if needed principal = this.delegate.authenticate(request.getRequest(), response); if (principal != null) { register(request, response, principal, getAuthenticationMethod(), null, null); result = true; } } else { result = true; } return result; }