WSO2 Identity Server SMS OTP多因素认证短信模板配置无效求助
解决WSO2 IS 6.1.0中SMSOTP本地化短信模板不生效的问题
1. 修正Locale格式错误
WSO2 IS 要求Locale格式为语言代码-大写国家代码(例如fr_FR),你配置的fr_fr不符合系统识别规则,这是导致本地化模板不生效的核心原因。
2. 确保SMS模板配置结构正确
确认你的配置完全包裹在<sms-templates>根节点下,且XML语法无错误。正确配置示例如下:
<sms-templates> <configuration type="SMSOTP" display="SMSOTP" locale="en_US"> <body>Your one-time password for the {{application-name}} is {{otpToken}}. This expires in {{otp-expiry-time}} minutes.</body> </configuration> <configuration type="SMSOTP" display="SMSOTP" locale="fr_FR"> <body>Votre code à usage unique pour {{application-name}} est {{otpToken}}. Il expire dans {{otp-expiry-time}} minutes.</body> </configuration> </sms-templates>
3. 验证用户Locale设置
- 登录IS控制台,进入用户管理找到目标用户,检查其
Locale属性值是否为fr_FR(注意大小写)。 - 如果是通过登录请求传递Locale,确保请求参数
locale的值为fr_FR。
4. 重启WSO2 IS服务
修改sms-templates-admin-config.xml后,必须重启IS服务才能让新配置生效,这一步不可省略。
5. 排查日志(可选)
若以上步骤仍未解决问题,启用org.wso2.carbon.identity.authenticator.smsotp包的DEBUG日志,查看:
- 系统是否正确获取到用户的
fr_FRLocale - 是否加载了对应Locale的SMS模板
内容的提问来源于stack exchange,提问作者user666
相关产品推荐
相关产品推荐

