0

I am looking for a JavaScript example to play with the Microsoft Graph API. Although I have found https://github.com/OfficeDev/O365-Angular-Microsoft-Graph-Connect; I don't get it to work. Do I need to be an AAD admin to get it properly registered? I am only a regular user of my organization's Office365 tenant.

I have used the wizard at http://graph.microsoft.io/app-registration. I both registered the app via 1) the current Registration Tool and 2) the new Registration Portal. Both routes provided me a unique clientId. When I try to run the Angular example via clientId 1 I get the following error:

AADSTS90093: Calling principal cannot consent due to lack of permissions.

And via clientId 2 I get the following error:

Application '<clientId>' is not supported for this API version.

What is your guidance?

2 Answers 2

3

Depending on the permissions you configured for your application it may need your administrator's approval. These permissions are known as ones that require admin consent and are specified at http://graph.microsoft.io/docs/authorization/permission_scopes.

If you are building a new application it would be the easiest if you used a developer tenant. You can get it at http://dev.office.com/devprogram. That way you will be able to easily try out different options without requesting changes in your production environment all the time.

3

Totally agree with Waldek here - this is great advice when getting started building your app. OK - there are 3 registration portals you can try as listed here http://graph.microsoft.io/app-registration. Adding some more details on each of these below:

  1. The lightweight one that Office built here: http://dev.office.com/app-registration which is probably the easiest to use, and get started with, plus using that experience, it'll give you the opportunity to download a working sample in the language of your choice (JS should be an option).
  2. The Azure management portal - https://manage.windowsazure.com. This portal REQUIRES that you have an Azure subscription before you can use it. This is a more heavyweight portal, but it does allow you to fully customize your app registration.
  3. The "New" app registration portal: https://apps.dev.microsoft.com/Disambiguation?ru=https%3a%2f%2fapps.dev.microsoft.com%2f. This is part of a preview of an update to our identity platform that supports converged auth sign in with a Microsoft account or a work/school org account, and allows your app to acquire a token to call APIs that support consumer or commercial account. This is the v2 of our authorization and token endpoints for converged auth. Microsoft Graph DOES support apps registered for converged auth. The second issue you got (clientId not supported for this version), was probably due to your app (a new converged auth app that is only supported by the v2 auth endpoints) trying to acquire a token from the v1 auth endpoint. Please refer to the documentation on converged auth here: http://graph.microsoft.io/docs/authorization/converged_auth.

Hope this helps,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.