Package org.exoplatform.web.security.security

Examples of org.exoplatform.web.security.security.AbstractTokenService


      {
         //
         String token = getRememberMeTokenCookie(req);
         if (token != null)
         {
            AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
            credentials = tokenService.validateToken(token, false);
            if (credentials == null)
            {
               log.debug("Login initiated with no credentials in session but found token an invalid " + token + " " +
                  "that will be cleared in next response");
View Full Code Here


                    // Handle remember me
                    String rememberme = req.getParameter("rememberme");
                    if ("true".equals(rememberme)) {
                        // Create token for credentials
                        AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
                        String cookieToken = tokenService.createToken(credentials);

                        log.debug("Found a remember me request parameter, created a persistent token " + cookieToken
                                + " for it and set it up " + "in the next response");
                        Cookie cookie = new Cookie(COOKIE_NAME, cookieToken);
                        cookie.setPath(req.getContextPath());
                        cookie.setMaxAge((int) tokenService.getValidityTime());
                        resp.addCookie(cookie);
                    }
                }
            } else {
                log.debug("username or password not provided. Changing status to UNAUTHENTICATED");
View Full Code Here

      String tokenId = getTokenCookie(req);
      if (tokenId != null)
      {
         try
         {
            AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
            tokenService.deleteToken(tokenId);
         }
         catch (Exception e)
         {
            LOG.warn("Cannot delete the token '" + tokenId + "'", e);
         }
View Full Code Here

      {
         //
         String token = getRememberMeTokenCookie(req);
         if (token != null)
         {
            AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
            credentials = tokenService.validateToken(token, false);
            if (credentials == null)
            {
               log.debug("Login initiated with no credentials in session but found token an invalid " + token + " " +
                  "that will be cleared in next response");
View Full Code Here

         {
            boolean isRemember = "true".equals(req.getParameter(InitiateLoginServlet.COOKIE_NAME));
            if (isRemember)
            {
               //Create token
               AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
               Credentials credentials = getCredentials(req);
               String cookieToken = tokenService.createToken(credentials);

               log.debug("Found a remember me request parameter, created a persistent token " + cookieToken + " for it and set it up " +
                  "in the next response");
               Cookie cookie = new Cookie(InitiateLoginServlet.COOKIE_NAME, cookieToken);
               cookie.setPath(req.getContextPath());
               cookie.setMaxAge((int)tokenService.getValidityTime());
               resp.addCookie(cookie);
            }
         }
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.web.security.security.AbstractTokenService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.