How do I get group members from Graph API with default scope

Andreas Hesse 0 Reputation points
2024-01-24T12:34:25.4066667+00:00

So my app gets an access token with tenant_id and scope 'https://graph.microsoft.com/.default' but the token isn't the same as in the Graph Explorer. I just need my app to be able to do the same as in the browser so I don't have to copy the token from the web into my CLI all the time. The documentation is intimidating and just so confusing. How do I make my app have the same permissions as me?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-01-25T07:25:53.4266667+00:00

    Hi @Andreas Hesse,

    If you want to verify whether your token has the relevant permissions to access group members, you can parse the token in this link and then check whether the scp attribute has permissions:

    User's image

    Here are the permissions required to list group members: List group members permissions.

    To add graph permissions, you can follow steps below:

    1. Go to the app's API permissions page.
    2. Select Add a permission and then choose Microsoft Graph in the flyout.
    3. Select Delegated permissions or Application permissions.
    4. Use the search box to find and select the required permissions.

    User's image

    If you want to build a project to call Microsoft Graph Api, you can refer to the code in the official documentation:

    Choose a Microsoft Graph authentication provider based on the scenario.

    List group members.

    Hope this helps.

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

    1 person found this answer helpful.

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.