Getting a 401 error TokenProfileBlockedBasedOnViolatedPolicy when using https://graph.microsoft.com/v1.0/me/calendar

debanjan c 30 Reputation points
2025-03-01T22:14:19.0366667+00:00

Getting this error when using any endpoint for calendar like delta or getSchedule.
"code"=>"TokenProfileBlockedBasedOnViolatedPolicy"
"message"=>"This token profile 'AadPft' is not expected to be sent based on violated policy ''

I am unable to find anywhere on the microsoft documentation regarding the error code and message, and how to solve it?

The app has the following auth scopes
["email", "mailboxsettings.read", "calendars.readwrite", "mail.send", "contacts.readwrite", "mail.readwrite", "mail.send", "openid", "profile", "user.read", "offline_access"]

Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-03-03T02:20:20.64+00:00

    Hello debanjan c,

    Thank you for reaching out to Microsoft Support!

    For your problem, the above two users seem to have the same experience, for this occasional problem, may be due to API upgrade or update caused, you need to wait for a period of time to retry, the problem will be automatically resolved.

    Similar questions:

    https://learn.microsoft.com/en-us/answers/questions/759462/graph-api-list-places-give-401-error

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.