我使用msal获取代币,如下所示:
const msal = require('@azure/msal-node');
const msalConfig = {
auth: {
clientId: config.MS_CLIENT_ID,
authority: config.AAD_ENDPOINT + 'consumers', //config.TENANT_ID,
clientSecret: config.MS_CLIENT_SECRET,
}
};
const cca = new msal.ConfidentialClientApplication(msalConfig);
const authCodeUrlParameters = {
scopes: ["Mail.ReadWrite"],
redirectUri: config.MS_REDIRECT_URI,
};
// get url to sign user in and consent to scopes needed for application
cca.getAuthCodeUrl(authCodeUrlParameters);
let tokenReq = {
code: ctx.params.Token,
scopes: ["Mail.ReadWrite"],
redirectUri: config.MS_REDIRECT_URI
}
const tokenRes = await cca.acquireTokenByCode(tokenReq);
我没有从acquiretokenbycode方法获取刷新令牌
暂无答案!
目前还没有任何答案,快来回答吧!