5 Replies Latest reply on Feb 6, 2007 9:03 AM by berserksangr

    A suggestion for improvements in Remember me (JBSEAM-735)

    berserksangr Newbie

      First of all, thank you for your hard work!
      Watching comments on the new Remember me functionality I have a suggestion to replace current basic (in my opinion not sufficient) user-name-cookie approach by the following, far more secure scenario:

      Create Rembember me Cookie:
      1.1. get: username, expiryTime(optional), passwordHash(!!!), customStringToken.
      1.2. create MD5/SHA1 digest from the fields above
      1.3. Store base64-encoded username+digest value in a cookie, setting expiriation date. Send it to user.

      Validate user:
      2.1. get Cookie, decode base64-encoded value
      2.2. load user data by username
      2.3. calculate MD5/SHA1 digest from exactly these values that were used in 1.1 (getting these from retrieved-by-name user data. request etc)
      2.4. compare this newly calculated digest to the one stored with the cookie, if they match we are sure that the remember me token is valid and allow user to log in.

      The fields in point 1.1 can/should be optionally extended to secure against naive cookie-hijacking issues (hostname?)


      Regards,
      Przemek.