Closed Lengo46 closed 2 years ago
I'm getting the exact same response, though in my case I'm trying to access /me/photo rather than /me/calendars. The "User.Read" permission is present in my scopes, and this is not a personal account so /photo is supported.
@Lengo46 Did you ever find a solution?
I am having the same issue. Did anyone find a solution? @Lengo46 @swc
I got it working with adding a redirectUri and postLogoutRedirectUri, and not using request
Vue.use(msal, {
auth: {
clientId: 'XXXX-XXX-XXXX',
requireAuthOnInitialize: false,
authority: 'https://login.microsoftonline.com/XXXX-XXXX-XXXX/',
redirectUri: process.env.VUE_APP_FRONTEND,
postLogoutRedirectUri: process.env.VUE_APP_FRONTEND,
},
system: {
tokenRenewalOffsetSeconds: 1000,
},
})
If I use the /me, it is working. If I change the URL to https://graph.microsoft.com/v1.0/me/calendars, it giving a 401 error.
let result = await this.$msal.msGraph('https://graph.microsoft.com/v1.0/me/calendars');
I've done the following steps.
wait this.$msal.acquireToken({ scopes: ["user.read", "Calendars.ReadWrite", "Calendars.ReadWrite.Shared"] })
, still no luckhttps://developer.microsoft.com/en-us/graph/graph-explorer
is workingVue.use(msal, { auth: { clientId: 'a8d208xee-dc-x4x03x8xx-XXXX-fxx17d8e8d0119', requireAuthOnInitialize: true, authority: 'https://login.microsoftonline.com/72046464-XXXX-XXX-85exxc-594e7bb34df4/' }, request: { scopes: ["user.read", "Calendars.ReadWrite", "Calendars.ReadWrite.Shared"] } });
{ "error": { "code": "NoPermissionsInAccessToken", "message": "The token contains no permissions, or permissions can not be understood.", "innerError": { "requestId": "df85ed16-f3a7-49ff-83e4-e62bf0b4fe6d", "date": "2020-10-07T10:38:53", "request-id": "df85ed16-XXXX-49ff-XXX-e62bf0b4fe6d", "client-request-id": "df85ed16-f3a7-XXXX-XXXXX-e62bf0b4fe6d" } } }