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