【发布时间】:2016-04-11 22:40:52
【问题描述】:
背景
我正在使用更新的 Yodlee Aggregation API,这与我之前构建的 API 不同。
我目前在帐户注册流程中使用此端点来放置 MFA 响应:
PUT /{cobrandName}/v1/providers/{providerAccountId}
我的请求如下所示:
{
url: `${this.rest}providers/${providerAccountId}`,
headers: {
'Authorization': `cobSession=${self.appToken}, userSession=${token}`
},
form: {
'MFAChallenge': JSON.stringify(newMfa)
}
}
this.rest 是我的个人休息 url,providerAccountId 是刷新的相应 providerAccountId,self.appToken 是当前联合品牌会话令牌,token 是当前用户的登录令牌,newMfa 是匹配此配置文件的字符串化 JSON 对象:
{
"loginForm": {
"mfaTimeout": 94650,
"formType": "questionAndAnswer",
"row": [
{
"id": "SQandA--QUESTION_1--Row--1",
"fieldRowChoice": "0001",
"form": "0001",
"label": "What is the name of your state?",
"field": [
{
"id": "SQandA_QUESTION_1_1",
"name": "QUESTION_1",
"isOptional": false,
"value": "Enter the answer",
"valueEditable": true,
"type": "text"
}
]
},
{
"id": "SQandA--QUESTION_2--Row--2",
"fieldRowChoice": "0001",
"form": "0001",
"label": "What is the name of your first school",
"field": [
{
"id": "SQandA_QUESTION_2_2",
"name": "QUESTION_2",
"isOptional": false,
"value": "Enter the answer",
"valueEditable": true,
"type": "text"
}
]
}
]
}
例外是 field 对象的 value 字段,已按照说明使用 PKI 加密。
问题
但是,当我执行此 PUT 请求时,我从 Yodlee 收到此错误:
{ errorCode: 'Y803',
errorMessage: 'MFAChallenge or providerParam required',
referenceCode: 'p1460412835654A4Q24t' }
虽然我的表单中有一个 MFChallenge 参数。如果 MFAChallenge 存在,为什么我会收到此错误的任何想法(请注意,除了通过标头或 url 参数之外,它是通过 PUT 请求传递的唯一信息)?我尝试将其作为body 数据传递,但这似乎不起作用,而且实际上很少有API 端点使用body 而非形式编码的字符串,尽管至少有一个。
【问题讨论】:
标签: yodlee