Okta API:删除安全问题/忘记密码的挑战

时间:2018-09-10 22:10:46

标签: okta okta-api

我正在尝试使用以下okta-api https://developer.okta.com/docs/api/resources/users#update-profile删除用户的密码挑战。

我们有许多从Stormpath迁移的用户,其自定义问题是“ StormpathMigrationAnswer”(或类似问题),这些用户不知道答案是什么,因此无法完成密码重置。

我们要删除该问题,并为用户提供自己设置的机会。

我正在使用以下PUT请求,对要删除的值使用null(根据文档):

curl -v -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
  "credentials": {
    "password": {},
    "emails": [
      {
        "value": "xxx@yyy.com",
        "status": "VERIFIED",
        "type": "PRIMARY"
      }
    ],
    "provider": {
      "type": "OKTA",
      "name": "OKTA"
    },
    "recovery_question": {
      "question": null,
      "answer": null
    }
  }
}' "https://dev-123456.oktapreview.com/api/v1/users/${user-id}"

但是我遇到以下错误:

{
  "errorCode": "E0000001",
  "errorSummary": "Api validation failed: securityQuestion",
  "errorLink": "E0000001",
  "errorId": "oaeoRiOAnzMRLennnnnnnnn",
  "errorCauses": [
    {
      "errorSummary": "securityQuestion: This field is required when its parent is specified."
    },
    {
      "errorSummary": "securityAnswer: This field is required when its parent is specified."
    }
  ]
}

0 个答案:

没有答案