This discussion is archived
7 Replies Latest reply: Mar 27, 2013 9:47 AM by Lucas RSS

New generated password not being sent to email

Lucas Newbie
Currently Being Moderated
Hello,

I'm using a forgot password form to reset a user's password. For that I used ForgotPasswordHandler, and everything looks fine. The user types in his email address, then the handler finds the profile, generates a new password, set it to the profile, set the generatedPassword to true and send the mail with the new password. So far, so good, but when I went to test the email, I noticed that the password is not being sent in it. I've activated loggingDebug on most components that handle it and the password is being correctly generated, it's just not being sent.

In the template used, I'm using this to get the new password
<dsp:valueof param="newpassword" />
I'm also using InternalUserProfiles, if that makes any difference.

Does anyone know why isn't the password being sent to the email?

Thanks,
Lucas
  • 1. Re: New generated password not being sent to email
    Rajeev_R Journeyer
    Currently Being Moderated
    Try in this way <%=request.getParameter("newpassword")%>

    I guess it is not retrieving the value using <dsp:valueOf>.

    Cheers
    R
  • 2. Re: New generated password not being sent to email
    Lucas Newbie
    Currently Being Moderated
    When using it like that, the newpassword comes "null" instead of empty... Although it shouldn't.

    Maybe the parameter is not being set to the request.
    But why?

    Regards,
    Lucas
  • 3. Re: New generated password not being sent to email
    RMishra Journeyer
    Currently Being Moderated
    Does anyone know why isn't the password being sent to the email?
    Are you able to recieve email without password?
    Also can you check what is value of newPasswordParam property in DPS/version/10.1.1/templates/DPS/config/userprofiling/atg/userprofiling/ForgotPasswordHandler.properties component?
    For me this component has below entries:
    /atg/userprofiling/ForgotPasswordHandler.properties
    $class=atg.userprofiling.ForgotPasswordHandler
    $scope=request
    templateEmailInfo=/somepath/ForgotPasswordEmailInfo
    templateEmailSender=/atg/userprofiling/email/TemplateEmailSender
    #newPasswordParam=newpassword
    In OOTB newPasswordParam=newpassword is commented as [#newPasswordParam=newpassword]. just override this component and remove comment if you have not already done.

    -RMishra

    Edited by: RMishra on Mar 12, 2013 5:29 PM
  • 4. Re: New generated password not being sent to email
    Lucas Newbie
    Currently Being Moderated
    I've overriden the component and set the property, but still the same thing.

    Here's the debug of TemplateEmailSender, maybe it helps with something:
    **** debug     Tue Mar 12 08:40:51 BRT 2013     1363088451234     /atg/userprofiling/email/TemplateEmailSender     Starting TemplateEmailSender, persistence is on
    **** debug     Tue Mar 12 08:43:51 BRT 2013     1363088631738     /atg/userprofiling/email/TemplateEmailSender     [New Debug] Template Parameters: java.util.HashMap@be4377[threshold=1,loadFactor=0.75]
    **** debug     Tue Mar 12 08:43:51 BRT 2013     1363088631739     /atg/userprofiling/email/TemplateEmailSender     [New Debug] Key: newpassword Value: lPUHUIMm
    **** debug     Tue Mar 12 08:43:51 BRT 2013     1363088631739     /atg/userprofiling/email/TemplateEmailSender     sendEmailMessage invoked.
    ...
    **** debug     Tue Mar 12 08:43:51 BRT 2013     1363088631740     /atg/dynamo/servlet/pipeline/RequestScopeManager/RequestScope-2/atg/userprofiling/ForgotPasswordHandler     success - redirecting to: login.jsp
    ...
    **** debug     Tue Mar 12 08:43:51 BRT 2013     1363088631771     /atg/userprofiling/email/TemplateEmailSender     created session atg.servlet.sessiontracking.GenericHttpSession@efbfe
    with id Q6n0R1JXk5QJ6pXhMFZMGCyZpZYGDG7DS0GGRzTnbqMS40VJY02X!-871225355!1363088631764 parent session id = 
    Q6n0R1JXk5QJ6pXhMFZMGCyZpZYGDG7DS0GGRzTnbqMS40VJY02X!-871225355!1363088631764, cookieString = JSESSIONID=Q6n0R1JXk5QJ6pXhMFZMGCyZpZYGDG7DS0GGRzTnbqMS40VJY02X!-871225355
    **** debug     Tue Mar 12 08:43:51 BRT 2013     1363088631784     /atg/userprofiling/email/TemplateEmailSender rendering 
    path info /emailtemplates/forgotPasswordEmailTemplate.jsp;jsessionid=Q6n0R1JXk5QJ6pXhMFZMGCyZpZYGDG7DS0GGRzTnbqMS40VJY02X!-871225355!1363088631764
    ...
    **** debug     Tue Mar 12 08:43:53 BRT 2013     1363088633331     /atg/userprofiling/email/TemplateEmailSender     Preparing to create message with text: 
    <table border="0" cellpadding="0" cellspacing="0" width="609" style="font-size: 14px; margin-top: 20px; margin-bottom: 30px">
    <tr> <td style="color: #666; font-family: Tahoma, Arial, sans-serif;"> Profile Id: iuser170004 Hello <br /><br />
    You have requested a password reset.<br /><br /> This is your new password: <div style="color: #000000"></div><br /><br /> 
    Please,  <a href="http://localhost:7005/login.jsp">Log in</a> and change your password. </td> </tr> </table>
    ...
    **** debug     Tue Mar 12 08:43:53 BRT 2013     1363088633332     /atg/userprofiling/email/TemplateEmailSender     creating message to user:iuser70009 (adminuser@localhost), contentType = text/html; charset=UTF-8
    **** debug     Tue Mar 12 08:43:53 BRT 2013     1363088633353     /atg/userprofiling/email/TemplateEmailSender     doSendEmailMessage: numMessages = 1
    **** debug     Tue Mar 12 08:43:53 BRT 2013     1363088633379     /atg/userprofiling/email/TemplateEmailSender     email sent to user:iuser70009 (adminuser@localhost)
    As you can see, the password is correct on the parameters map: {newpassword=lPUHUIMm}

    I think maybe the session has something to do with it. In the begining of the template you can see Profile Id: iuser170004, when the actual user id is user:iuser70009.

    Regards,
    Lucas
  • 5. Re: New generated password not being sent to email
    Lucas Newbie
    Currently Being Moderated
    I was searching the forum to see if I could find anything on this matter and found this:

    Re: TemplateParameters values in the TemplateEmailInfoImpl are losing..

    That's exactly my problem, but the link provided as being the solution no longer exists.

    I was trying to contact the guy who posted the message personaly, but I guess the forum doesn't have support for personal messages or something like that.

    Can anybody help me with this?

    Thanks,
    Lucas
  • 6. Re: New generated password not being sent to email
    Nitin Khare Expert
    Currently Being Moderated
    You may want to check the value for emptySessionPath attribute under the connector configuration in your server.xml. Set emptySessionPath value to true in all entries which will ensure that the jsessionid cookie will have a cookie path of / and all web-applications will use the same session-id value. Also check in case you are encountering the issue related to separate jsessionid cookie being created for each domain and apply the fix mentioned here:

    https://issues.jboss.org/browse/JBWEB-107

    See if this helps.
  • 7. Re: New generated password not being sent to email
    Lucas Newbie
    Currently Being Moderated
    The problem is solved.

    There is a parameter to set in web.xml, which solved the problem. The param is:
    <context-param> 
          <param-name>atg.session.parentContextName</param-name>
          <param-value>/dyn</param-value>
    </context-param>