/** * <p> * Overrides the parent method to return the cached authenticated account (that is, the account that was set in the * session as a result of a SAM setting the {@code javax.servlet.http.registerSession} property) when the regular * account is null. This allows a SAM to retrieve the cached account principal by calling {@code getUserPrincipal()} * on {@code HttpServletRequest}. * </p> * * @return the authenticated account (or cached account when it is null). */ @Override public Account getAuthenticatedAccount() { Account account = super.getAuthenticatedAccount(); if (account == null) account = this.cachedAuthenticatedAccount; return account; }
@Override public void logout() { Account authenticatedAccount = getAuthenticatedAccount(); if(authenticatedAccount != null) { UndertowLogger.SECURITY_LOGGER.debugf("Logging out user %s for %s", authenticatedAccount.getPrincipal().getName(), exchange); } else { UndertowLogger.SECURITY_LOGGER.debugf("Logout called with no authenticated user in exchange %s", exchange); } super.logout(); this.authenticationState = AuthenticationState.NOT_ATTEMPTED; }
/** * <p> * Overrides the parent method to return the cached authenticated account (that is, the account that was set in the * session as a result of a SAM setting the {@code javax.servlet.http.registerSession} property) when the regular * account is null. This allows a SAM to retrieve the cached account principal by calling {@code getUserPrincipal()} * on {@code HttpServletRequest}. * </p> * * @return the authenticated account (or cached account when it is null). */ @Override public Account getAuthenticatedAccount() { Account account = super.getAuthenticatedAccount(); if (account == null) account = this.cachedAuthenticatedAccount; return account; }
/** * <p> * Overrides the parent method to return the cached authenticated account (that is, the account that was set in the * session as a result of a SAM setting the {@code javax.servlet.http.registerSession} property) when the regular * account is null. This allows a SAM to retrieve the cached account principal by calling {@code getUserPrincipal()} * on {@code HttpServletRequest}. * </p> * * @return the authenticated account (or cached account when it is null). */ @Override public Account getAuthenticatedAccount() { Account account = super.getAuthenticatedAccount(); if (account == null) account = this.cachedAuthenticatedAccount; return account; }
@Override public void logout() { Account authenticatedAccount = getAuthenticatedAccount(); if(authenticatedAccount != null) { UndertowLogger.SECURITY_LOGGER.debugf("Logging out user %s for %s", authenticatedAccount.getPrincipal().getName(), exchange); } else { UndertowLogger.SECURITY_LOGGER.debugf("Logout called with no authenticated user in exchange %s", exchange); } super.logout(); this.authenticationState = AuthenticationState.NOT_ATTEMPTED; }
@Override public void logout() { Account authenticatedAccount = getAuthenticatedAccount(); if(authenticatedAccount != null) { UndertowLogger.SECURITY_LOGGER.debugf("Logging out user %s for %s", authenticatedAccount.getPrincipal().getName(), exchange); } else { UndertowLogger.SECURITY_LOGGER.debugf("Logout called with no authenticated user in exchange %s", exchange); } super.logout(); this.authenticationState = AuthenticationState.NOT_ATTEMPTED; }