none
how to access graph apis using application created in active directory of portal.azure.com.

    Question

  • Insufficient privileges to complete the operation.Even though permissions assigned to that application.
    Thursday, April 6, 2017 6:29 AM

All replies

  • Please add details about what you have setup and what you have tried. The question as it is now is very broad.

    Perhaps add a screenshot of the application permissions, and also add the source code of the application where it tries to get access tokens etc.

    Thursday, April 6, 2017 8:18 AM
  • Monday, April 10, 2017 4:56 AM
  • I/P:

    url = "https://login.windows.net/" + resellerdomain + "/oauth2/token"
    content = {"grant_type": "client_credentials", "client_id": ApplicationId,
                       "client_secret": ApplicationSecret, "resource": "https://graph.windows.net}
    r = requests.post(url, data=content)
    token = r.json()["access_token"]
    params = urllib.urlencode({
                # Specify values for the following required parameters
                'api-version': '1.6',
                # Specify values for optional parameters, as needed
                # '$filter': 'startswith(displayName,'A')',
            })
    url = "https://graph.windows.net/myorganization/users?%s" % params
    headers = {"Authorization": "Bearer " + token}
    r = requests.get(url, headers=headers)


    O/P :"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."}}}
    Monday, April 10, 2017 5:02 AM