本文介绍了Okta API:短信多因素问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Web 应用程序中使用 Okta API,以允许用户激活/停用其帐户中的 SMS MFA 因素.但是,我遇到了一个问题,详情如下:

I'm attempting to use the Okta API in a web application to allow users to activate/deactivate a SMS MFA factor on their accounts. However, I'm running into an issue as detailed below:

首先,在新创建的帐户上:

First, on a newly created account:

  1. 通过注册注册短信因素Okta SMS Factor API 方法.
  2. 此因素随后通过激活短信因素激活 API方法.
  3. 然后我们使用 重置因子 API方法.
  1. An SMS factor is enrolled via the Enroll Okta SMS Factor API method.
  2. This factor is subsequently activated via the Acivate SMS Factor APImethod.
  3. Then we deactivate the factor using the Reset Factor APImethod.

所有这些都可以正常工作并且没有错误,但是,现在尝试再次注册 SMS 因素时:

All of this works fine and without errors, however, now when trying to enroll a SMS factor again:

stdClass Object
(
    [errorCode] => E0000001
    [errorSummary] => Api validation failed: factorEnrollRequest
    [errorLink] => E0000001
    [errorId] => oae3MBJJpGrR6Oj_MkGOxed_g
    [errorCauses] => Array
        (
            [0] => stdClass Object
                (
                    [errorSummary] => There is an existing verified phone number.
                )
        )
)

我该如何解决这个问题?我是否遗漏了必须删除以前验证过的电话号码的步骤?如果是这样,我该怎么做?

How can I resolve this issue? Am I missing a step where I have to remove a previously verified phone number? If so, how do I do that?

推荐答案

此端点的更新方法没有记录,但可以执行.

The update method for this endpoint isn't documented but it can be performed.

如果您之前删除了 SMS,我知道如何恢复该过程,并且知道之前注册的电话号码.

I do not know how to recover the process if you have previously removed SMS and do not know the previously registered phone number.

除此之外,如果您要更改号码,请执行以下操作.

Outside of that scenario, if you are changing a number do the following.

  1. 获取完整的因素列表
  2. 确定要更改的 SMS 因素(我们需要 fid)
  3. 使用现有短信的因子 ID 和新电话号码

  1. Get the full list of factors
  2. Identify the SMS factor to be changed (we need the fid)
  3. Using the factor id of the existing SMS and the new phone number

POST https://{yourorg}.com/api/v1/users/{:uid}/factors/{:fid}
{
    "profile":
    {
        "phoneNumber": "+1 555 123 1234"
    }
}

  • 响应将与 新注册短信因素

    如果您遇到重置前一个因素并且您不知道 fid 但知道数字的情况,您可以 注册号码,检索该 fid,然后开始上述序列.

    If you run into a situation where the previous factor was reset and you don't know the fid but do know the number you can enroll the number, retrieve that fid and then begin the sequence described above.

    这篇关于Okta API:短信多因素问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

  • 08-24 06:56