@Override public void logout() { authenticationService.logout(); }
protected AuthenticationDetails loginMiddleware(LoginPasswordCredentials credentials) throws LoginException { return authenticationService.login(credentials); }
@Override public UserSession substituteUser(User substitutedUser) { return authenticationService.substituteUser(substitutedUser); }
try { AbstractClientCredentials credentials = new LoginPasswordCredentials(username, password, locale); UserSession userSession = authenticationService.login(credentials).getSession(); AppContext.setSecurityContext(new SecurityContext(userSession)); try { authenticationService.logout(); } finally { AppContext.setSecurityContext(null);
protected AuthenticationDetails loginMiddleware(LoginPasswordCredentials credentials) throws LoginException { return authenticationService.login(credentials); }
protected void doLogout(String sessionUUID, HttpServletResponse response) throws IOException, JSONException { try { if (authentication.begin(sessionUUID)) { AuthenticationService authenticationService = AppBeans.get(AuthenticationService.NAME); authenticationService.logout(); } } catch (Throwable e) { log.error("Error processing logout request", e); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }
@Override public void substituteUser(User substitutedUser) { UserSession previousSession = getSession(); UserSession session = authenticationService.substituteUser(substitutedUser); ClientUserSession clientUserSession = createSession(session); clientUserSession.setAuthenticated(true); setSessionInternal(clientUserSession); publishUserSessionSubstitutedEvent(previousSession, clientUserSession); fireSubstitutionListeners(); }
protected AuthenticationDetails loginMiddleware(Credentials credentials) throws LoginException { return authenticationService.login(credentials); }
@Override public synchronized void logout() { try { authenticationService.logout(); AppContext.setSecurityContext(null); } catch (Exception e) { log.warn("Error on logout", e); } connected = false; try { fireConnectionListeners(); } catch (LoginException e) { log.warn("Error on logout", e); } session = null; }
protected AuthenticationDetails loginMiddleware(TrustedClientCredentials credentials) throws LoginException { return authenticationService.login(credentials); }
protected void internalLogout() { if (session != null && session.isAuthenticated()) { authenticationService.logout(); } AppContext.setSecurityContext(null); connected = false; session = null; }
protected AuthenticationDetails loginMiddleware(LoginPasswordCredentials credentials) throws LoginException { return authenticationService.login(credentials); }
authenticationService.logout();
@Nullable @Override public AuthenticationDetails login(Credentials credentials) throws LoginException { if (!(credentials instanceof RememberMeCredentials)) { throw new ClassCastException("Credentials cannot be cast to RememberMeCredentials"); } return authenticationService.login(credentials); }
@Override public void logout() { backgroundWorker.checkUIAccess(); ClientUserSession session = getSessionInternal(); if (session == null) { throw new IllegalStateException("There is no active session"); } if (!session.isAuthenticated()) { throw new IllegalStateException("Active session is not authenticated"); } if (session.isAuthenticated()) { try { authenticationService.logout(); } catch (NoUserSessionException e) { log.debug("An attempt to perform logout for expired session: {}", session, e); } } publishUserSessionFinishedEvent(session); UserSession previousSession = getSession(); setSessionInternal(null); eventHub.unsubscribe(UserSubstitutedEvent.class); publishDisconnectedEvent(previousSession); fireStateChangeListeners(previousSession, null); }
@Override public UserSession login(String login, String password, Locale locale, Map<String, Object> params) throws LoginException { LoginPasswordCredentials credentials = new LoginPasswordCredentials(login, password, locale, params); copyParamsToCredentials(params, credentials); return authenticationService.login(credentials).getSession(); }
@Override public UserSession loginByRememberMe(String login, String rememberMeToken, Locale locale, Map<String, Object> params) throws LoginException { RememberMeCredentials credentials = new RememberMeCredentials(login, rememberMeToken, locale, params); copyParamsToCredentials(params, credentials); return authenticationService.login(credentials).getSession(); }
session = authenticationService.login(credentials).getSession(); } catch (RestApiAccessDeniedException ex) { log.info("User is not allowed to use the REST API {}", login);
session = authenticationService.login(credentials).getSession(); } catch (LoginException e) { throw new OAuth2Exception("Cannot login to the middleware", e);