Package com.jeecms.common.security.userdetails

Examples of com.jeecms.common.security.userdetails.UserDetails


    }
    // Check the user exists.
    // Defer lookup until after expiry time checked, to possibly avoid
    // expensive database call.

    UserDetails user = getUserDetailsService().loadUser(userId,
        cookieTokens[0]);

    // Check signature of token matches remaining details.
    // Must do this after user lookup, as we need the DAO-derived password.
    // If efficiency was a major issue, just add in a UserCache
    // implementation,
    // but recall that this method is usually only called once per
    // HttpSession - if the token is valid,
    // it will cause SecurityContextHolder population, whilst if invalid,
    // will cause the cookie to be cancelled.
    String expectedTokenSignature = makeTokenSignature(tokenExpiryTime,
        user.getUsername(), user.getPassword(), user.getId());

    if (!expectedTokenSignature.equals(cookieTokens[2])) {
      throw new InvalidCookieException(
          "Cookie token[2] contained signature '" + cookieTokens[2]
              + "' but expected '" + expectedTokenSignature + "'");
View Full Code Here


      return null;
    }

    logger.debug("Remember-me cookie detected");

    UserDetails user = null;

    String[] cookieTokens;
    try {
      cookieTokens = decodeCookie(rememberMeCookie);
      user = processAutoLoginCookie(cookieTokens, request, response);
View Full Code Here

TOP

Related Classes of com.jeecms.common.security.userdetails.UserDetails

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.