WSO2身份服务器{密码重置链接}

WSO2身份服务器{密码重置链接},wso2,wso2carbon,wso2is,Wso2,Wso2carbon,Wso2is,我的发言如下: 在sendRecoveryNotification()之前,一切正常 我可以发送一封密码重置电子邮件,但该电子邮件只有 “{password reset link}”按字面意思编写,而不是定义的URL 在targetEpr中,附加确认键 {key}标签也写在电子邮件中,所以我无法 手动构建链接(我希望它可能会输出 确认键) 日志中似乎没有任何有用的内容 以前有人遇到过这个问题吗?我没有看到过,但您的userParameters上下文肯定有问题 org.wso2.carbon.id

我的发言如下:

在sendRecoveryNotification()之前,一切正常

我可以发送一封密码重置电子邮件,但该电子邮件只有 “{password reset link}”按字面意思编写,而不是定义的URL 在targetEpr中,附加确认键

{key}标签也写在电子邮件中,所以我无法 手动构建链接(我希望它可能会输出 确认键)

日志中似乎没有任何有用的内容


以前有人遇到过这个问题吗?

我没有看到过,但您的userParameters上下文肯定有问题

org.wso2.carbon.identity.mgt.mail.DefaultEmailSendingModule.replacePlaceHolders()具有以下代码:

公共静态字符串替换占位符(字符串文本、映射用户参数){
if(userParameters!=null){
对于(Map.Entry:userParameters.entrySet()){
String key=entry.getKey();
if(key!=null&&entry.getValue()!=null){
text=text.replaceAll(“\\{”+key+“\\}”,entry.getValue());
}
}         }
返回文本;
}
因此,如果未替换令牌,则它一定不在传入的userParameters中

这可能会有帮助

此外,重置电子邮件模板是FUBAR,不会像产品中发送的那样工作

电子邮件模板中的链接如下: {确认码}

正常工作的正确重置链接还必须具有{user name}标记:

{确认码}&username={user name}

是的,这需要使用WSO2才能实现。我要求在发布产品中修复此问题

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;
}