How to fix "Access has been blocked by Conditional Access policies." in MS Graph

Wesley Oliveira 20 Reputation points
2025-01-22T13:24:39.85+00:00

Greetings!

I'm trying to reatrive some e-mails from my mail box using a python code with msallib. As I'm using a personal e-mail I set the auth url as "https://login.microsoftonline.com/common". It was working when my auth url was /{tenant_id}, but since I made this change I keep getting the error bellow whenever I run the app.

'error': 'invalid_grant', 'error_description': 'AADSTS53003: Access has been blocked by Conditional Access policies. The access policy does not allow token issuance.'

When I look into the sign-in logs, there is nothing in the Conditional Access:

User's image

What should I do? I'm losing my hopes...

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,928 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Andy David - MVP 151.8K Reputation points MVP
    2025-01-22T13:28:46.3833333+00:00

    Look in the non interactive logs instead. If , for example, your access to Office 365 was blocked by a CA policy, then that would affect your Graph access.


  2. Andy David - MVP 151.8K Reputation points MVP
    2025-01-22T14:22:35.65+00:00

    How about under Service Principal Logins?


  3. Andy David - MVP 151.8K Reputation points MVP
    2025-01-22T14:44:59.1066667+00:00

    not sure using the /common endpoint is the way here. You said it works with the tenantID?


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.