WSO2 IS - 更新号码时启用手机号码验证

WSO2 IS - Enable Mobile Number Verification when number is updated

我们正在尝试根据 this guide 使用 WSO2 身份服务器 (v5.11.0) 对手机号码更新进行手机号码验证,同时发送 SMS OTP,它被发送到旧的手机号码.

示例: 手机号111111的用户

我们正在向 SCIM2.0 API https:///hostname/scim2/Me 发送请求,以使用以下请求更新手机号码:


{
   "schemas":[
      "urn:ietf:params:scim:api:messages:2.0:PatchOp"
   ],
   "Operations":[
      {
         "op":"replace",
         "value":{
            "phoneNumbers":[
               {
                  "type":"mobile",
                  "value":"222222"
               }
            ],
            "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{
               "verifyMobile":true
            }
         }
      }
   ]
}

短信 OTP 正在发送到旧手机号码 (111111) 而不是新手机号码 (222222)

指南明确指出:

When a user updates their mobile number in the user profile, an SMS OTP is sent to the new mobile number.

是否有另一种方法来配置该功能,我们是否遗漏了一个步骤?还是应该修改请求以使我们具有正确的行为?

PS: 服务器按照指南配置

看起来在示例事件发布者中,SMS 发送到的号码定义为 "to"={{mobile}}。这将选择根据声明 http://wso2.org/claims/mobile 保留的现有手机号码。将该值更改为 to"={{send-to}}。然后它会将短信发送到待验证的手机号码。更新后的示例事件发布者应如下所示。

<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="HTTPOutputEventAdapter" processing="enable"
    statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
    <from streamName="id_gov_sms_notify_stream" version="1.0.0"/>
    <mapping customMapping="enable" type="json">
        <inline>{"api_key"="xxxxxx",
            "api_secret"="xxxxxxxx",
            "from"="NEXMO",
            "to"={{send-to}},
            "text"={{body}}
            }</inline>
    </mapping>
    <to eventAdapterType="http">
        <property name="http.client.method">httpPost</property>
        <property name="http.url">https://rest.nexmo.com/sms/json</property>
    </to>
</eventPublisher>