我关注:https://docs.wso2.com/display/IS500/Recover+with+Notification
在sendRecoveryNotification()之前,一切正常。
我可以发送密码重置电子邮件,但电子邮件只是 “{password-reset-link}”字面上写的,而不是定义的URL 在targetEpr中附加了确认密钥。
{key}标签也是字面意思写在电子邮件中,所以我无法做到 手动构建链接(我原以为它可能会输出 确认密钥)。
日志中似乎没有任何用处。
以前有人遇到过这个问题吗?
答案 0 :(得分:2)
我还没有看到这个,但是你的userParameters上下文一定存在问题
org.wso2.carbon.identity.mgt.mail.DefaultEmailSendingModule.replacePlaceHolders()有以下代码:
public static String replacePlaceHolders(String text, Map<String, String> userParameters) { if (userParameters != null) { for (Map.Entry<String, String> entry : userParameters.entrySet()) { String key = entry.getKey(); if (key != null && entry.getValue() != null) { text = text.replaceAll("\\{" + key + "\\}", entry.getValue()); } } } return text; }
所以如果令牌没有被替换,那么它一定不会在传入的userParameters中。
这可能是一种帮助...
此外,重置电子邮件模板是FUBAR,并且无法在产品中发送。
电子邮件模板中的链接是: http://localhost:[PORT]/InfoRecoverySample/infoRecover/verify?confirmation= {确认代码}
正常的重置链接必须具有{user-name}令牌:
http://localhost:[PORT]/InfoRecoverySample/infoRecover/verify?confirmation= {确认代码}&安培;用户名= {用户名}
是的,它与WSO2一起使用了。我要求在发布产品中修复此问题