No access to Azure active directory error 403

Tinto Raj 1 Reputation point
2020-08-30T10:40:10.387+00:00

Could anybody tell why this error is occurring?21290-screenshot-151.png

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,702 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. VipulSparsh-MSFT 15,961 Reputation points
    2020-08-31T06:43:59.977+00:00

    @Tinto Raj Thanks for reaching out. From the screenshot we can see that you are logged in with your gmail account which should be the guest account to that AAD directory.

    Different services access are controlled by RBAC and an Admin controls who should see what.
    I would recommend to check with the tenant Admin to get you access for this if you need access.

    Also in order to prevent PII, in your future posts you can blur out the account and directory name.

    -----------------------------------------------------------------------------------------------------------------

    If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.


  2. Ritika Singh 1 Reputation point
    2021-12-30T11:06:05.84+00:00

    While from azure.common.credentials import ServicePrincipalCredentials
    from azure.graphrbac import GraphRbacManagementClient
    from azure.identity import ClientSecretCredential
    from msgraph.core import GraphClient

    clientid= ""
    clientsecret = ""
    tenantid = ""

    userList = []

    credentials=ClientSecretCredential(tenant_id=tenantid,client_id=clientid,client_secret=clientsecret)
    graph_client = GraphClient(credential=credentials)
    users = graph_client.get('/users?$select=userPrincipalName,id')
    users_list = print(users)

    print(users_list)

    while running this code, i am getting an error of response<403> None
    why ? can anyone help me

    No comments