0
我試圖按照一系列步驟的列表中https://auth0.com/docs/what-to-do-once-the-user-is-logged-in/calling-an-external-idp-api但儘管我最大的努力我無法得到我如下時,出現了錯誤的訪問令牌:呼叫身份提供API後Auth0認證
POST https://r***s.eu.auth0.com/oauth/token 401 (Unauthorized)
當我嘗試獲取訪問令牌。
我的代碼如下:
var data = {
client_id : '****',
client_secret : '****',
audience : 'https://r****.eu.auth0.com/api/v2/',
grant_type : 'client_credentials'
};
var config = {
json: true,
headers : {
'Content-Type': 'application/json;'
};
}
$http.post('https://r***.eu.auth0.com/oauth/token',data, config).then (
function(response) { console.log(response); }
);
您收到的'401'錯誤似乎表明請求的有效內容(正文)包含「client_id」和「client_secret」的不正確或缺失值。 沒有提供實際的'client_secret'(這是:)祕密),你能給出更多關於你如何調用'/ oauth/token'終點的信息嗎? –
根據Auth0網站指南中的操作列表,我創建了一個「非交互式」應用程序,並在我的有效負載中使用該應用程序的客戶端ID和祕密。 – Raghu