等待结果模式的 initiate+wait 的结果 API 合同
所使用因子支持 "initiate+wait for
result" 集成模式时,在运行时 MFA 质询期间,内部 Verify 组件会调用 result 资源。
push。 Verify 期望响应包含 status,它指示用户单独执行的 MFA 质询的成功、失败或暂挂状态。 以下代码示例是一个由 Verify 发送到实时 webhook 的 资源的 result 请求示例。 根据 Webhook 配置,此相同有效内容可直接发送至目标 MFA 提供程序,也可以转换为目标提供程序可接受的 API 客户机请求。POST '/result' \
'Content-Type: application/json' \
'Accept: application/json' \
{
"capability": "<<factor capability name, e.g. totp>>",
"id": "<<factor or device identifier from external provider>>",
"transactionId": "<<provider transaction identifier>>"
"attributes":
{
"username": "<<external MFA username>>"
}
}注意: 本示例中的 HTTP
/result 路径会根据 webhook 的配置而有所不同。结果请求详细信息
| Element | 描述 |
|---|---|
| HTTP 请求 | POST |
| HTTP 标头 - Content-Type | 请求有效内容的内容类型始终为 application/json。 |
| HTTP 标头 - 接受 | 期望的响应有效内容的内容类型始终为 application/json。 |
| 有效内容 | 表示要验证的令牌或传递值的 JSON 对象。 有效内容还标识用户及其关联 MFA 注册。 |
id |
必填。 用户已注册 MFA 因子功能的唯一标识。 |
capability |
必填。 标识 MFA 因子功能类型。 该值是有效字符串。 它必须与 Webhook 的关联 MFA 提供程序配置的其中一个功能相匹配。 |
transactionId |
可选。 事务或其他 MFA 提供程序认证质询状态句柄。 如果验证是作为 |
attributes |
必填。 验证特定于请求的其他属性。 |
attributes.username |
必填。 请求对其进行验证的外部提供程序系统中用户的名称。 |
attributes.passvalue |
必填。 要验证的令牌或值。 |
result 响应有效内容。{
"attributes": {
"<<any name>>": "<<any value>>"
},
"status": "PENDING"
}结果响应详细信息
| 元素 | 描述 |
|---|---|
| 有效内容类型 | 表示验证尝试状态的 JSON 对象。 |
| HTTP 状态码 | 请参阅 HTTP Status。 |
status |
必填。 MFA 结果执行或完成状态。 有效值包括:SUCCESS、PENDING、TIMEOUT、CANCELED 和 FAILED |
attributes |
可选。 返回到已触发 MFA 质询的公共 Verify 客户机的其他属性。 可以存在任何其他属性和值。 |