Skip to content

How to list delegated permissions for an app using Microsoft Graph.

Delegated permissions, also called scopes or OAuth2 permissions, allow an app to call an API on behalf of a signed-in user.

Permissions

Requires delegated permission AppRoleAssignment.ReadWrite.All.

Reference

View source

from office365.graph_client import GraphClient
from tests import test_admin_principal_name, test_client_id, test_tenant

client = (
    GraphClient(tenant=test_tenant)
    .with_token_interactive(test_client_id, test_admin_principal_name)
    .require_role("Global Administrator", "Privileged Role Administrator")
)

result = client.get_delegated_permissions(test_client_id).execute_query()

for scope in result.value:
    print(scope)

← Back to Application Registration & Permissions