Search in sources :

Example 21 with UserSession

use of io.vertigo.persona.security.UserSession in project vertigo by KleeGroup.

the class SecurityFilter method obtainUserSession.

/**
 * Retourne la session utilisateur.
 *
 * @return Session utilisateur
 * @param request HTTPRequest
 */
private UserSession obtainUserSession(final HttpServletRequest request) {
    final HttpSession session = request.getSession(false);
    UserSession user = getUserSession(session);
    // Si la session user n'est pas créée on la crée
    if (user == null) {
        user = securityManager.createUserSession();
        if (session != null) {
            session.setAttribute(USER_SESSION, user);
        }
    }
    return user;
}
Also used : HttpSession(javax.servlet.http.HttpSession) UserSession(io.vertigo.persona.security.UserSession)

Aggregations

UserSession (io.vertigo.persona.security.UserSession)21 Test (org.junit.Test)14 TestUserSession (io.vertigo.account.data.TestUserSession)13 Authorization (io.vertigo.account.authorization.metamodel.Authorization)9 Record (io.vertigo.account.authorization.model.Record)8 Account (io.vertigo.account.account.Account)2 AuthenticationToken (io.vertigo.account.authentication.AuthenticationToken)2 UsernamePasswordAuthenticationToken (io.vertigo.account.impl.authentication.UsernamePasswordAuthenticationToken)2 SessionException (io.vertigo.vega.webservice.exception.SessionException)2 UserAuthorizations (io.vertigo.account.authorization.UserAuthorizations)1 PostgreSqlDataBase (io.vertigo.database.impl.sql.vendor.postgresql.PostgreSqlDataBase)1 SqlDialect (io.vertigo.database.sql.vendor.SqlDialect)1 CriteriaCtx (io.vertigo.dynamo.criteria.CriteriaCtx)1 VSecurityException (io.vertigo.vega.webservice.exception.VSecurityException)1 Locale (java.util.Locale)1 ServletException (javax.servlet.ServletException)1 HttpSession (javax.servlet.http.HttpSession)1 Session (spark.Session)1