0
我正面臨嘗試通過node.js客戶端使用細分API的授權問題。 停止旁敲側擊,它的部分,低於該管理POST請求,並通過X-WSSE頭的授權:使用node.js客戶端的Adobe Analytics細分API驗證問題
var now = new Date();
var options = {
method: "POST",
hostname: "api3.omniture.com",
path: "/admin/1.4/rest/?method=Segments.Get",
json: true,
headers: {
"Content-Type": "application/json",
"Content-Length" : Buffer.byteLength(JSON.stringify(body)),
"x-wsse": 'UsernameToken Username="[username]:[company]", PasswordDigest="xxxxxxxxxxxxxxxxxxxxxxxxxx==", Nonce="yyyyyyyyyyyyyyyyyyyyyyyyyy", Created="'+now+'"'
}
};
正如你看到的,我試圖通過複製產生的x WSSE API Explorer,通過Date()JS類動態指定Created timestap。 節點客戶端報告我這個錯誤:
{「錯誤」:「錯誤的請求」,「ERROR_DESCRIPTION」:「無法驗證身份驗證」,「error_uri」:空}
我想的x wsse PasswordDigest和Nonce值也會在每個請求中不斷更改,而在這裏我將它們設置爲靜態。 如果這是問題的原因,那麼如何動態地將這些參數插入到x-wsse頭文件中?
非常感謝。
@RiccardoMalesani順便說一句看起來像Adobe確實有[節點sdk](https://github.com/Adobe-Marketing-Cloud/marketing-cloud-node-sdk),可能有助於參考(或只是使用..不知道你的最終境況是什麼!) –