使用 oAuth 为 Azure Active Directory 中的某个 outlook 日历授予权限并获取令牌

问题描述 投票:0回答:0

我目前正在使用 oAuth 通过

Calendars.ReadWrite
范围获取令牌,但它适用于用户拥有的所有日历。这是我的代码:

const PCA = new PublicClientApplication({
    auth: {
        clientId: "***",
        authority: "https://login.microsoftonline.com/common",
        redirectUri: "http://localhost:8080/"
    }
});

PCA.loginPopup({ scopes: ["User.Read", "Calendars.ReadWrite"] })
    .then((response) => {
        console.log(response.accessToken)
    })
    .catch(function (error) {
        console.log(error);
    });

我在想,有没有办法根据特定的日历获取令牌?我想要一个令牌,它只适用于用户选择的同一日历,不适用于用户拥有的其他日历。

javascript oauth-2.0 outlook azure-active-directory msal
© www.soinside.com 2019 - 2024. All rights reserved.