Tim Biegeleisen
Tim Biegeleisen

Reputation: 521457

WSO2 recovery notification always defaulting to passwordReset

We are currently trying to use WSO2 to send a recovery email for unlocking newly created user accounts. To be concise, here are the relevant two lines of Java code which are attempting to do this:

String key = userInfoutil.verifyUser("[email protected]", captchaBean);
userInfoutil.sendRecoveryNotification("[email protected]", key, "accountUnLock");

Here are what the three parameters to sendRecoveryNotification() are:

[email protected] - user/tenant to notify
key                 - authorization string based off Captcha
accountUnLock       - email template to use for recovery message

However, what we have observed is that the passwordReset template always gets used. In other words, it ignores whatever we specify and sends a password reset email. We also verified the same behavior when calling the service directly from SOAP UI for the same user. In addition, when we comment out the passwordReset configuration from the email-admin-config.xml file, we get a NullPointerException. So it seems that the WSO2 server is hell-bent on using passwordReset.

This problem is difficult to diagnose because the code where the exception happens is on the WSO2 server itself, and not in our own code. As far as we know, we have the configuration correct.

Massive upvote coming to anyone who can even shed light on this problem.

Upvotes: 1

Views: 110

Answers (1)

The third parameter in sendRecoveryNotification is not the email template. It is the type of notification that should be sent to the user like email, SMS. By default, Identity Server supports only email.

What is the requirement? Why can't you use passwordReset templates?

Thanks
Isura

Upvotes: 1

Related Questions