我正在制作一个通过刷新令牌获取新访问令牌的函数
kinit -k -t /etc/security/keytabs/yarn-ats.hbase-master.service.keytab yarn-ats-hbase/HOSTNAME@HUB.LOCAL
kinit -k -t /etc/security/keytabs/hdfs.headless.keytab hdfs-trinitylocal@HUB.LOCAL
kinit -k -t /etc/security/keytabs/hbase.service.keytab hbase/trinity.hub.local@HUB.LOCAL
但是当我运行代码时,出现此错误:
const getAccessToken = async refreshToken => {
try {
const accessTokenObj = await axios.post(
'https://login.microsoftonline.com/common/oauth2/token',
querystring.stringify({
refresh_token: refreshToken,
client_id: 'xxxxx',
client_secret: 'xxxxx',
grant_type: 'refresh_token',
resource: 'https://graph.microsoft.com',
prompt: 'admin_consent'
})
);
return accessTokenObj;
} catch (err) {
console.log(err);
}
};
所以我遵循this tutorial来授予管理员同意,因为我在应用程序中找不到The user or administrator has not consented to use the application with ID 'xxxxx' named 'xxxxx'. Send an interactive authorization request for this user and resource.
按钮。
我所缺少的是什么?我正在使用个人帐户创建应用程序。