4

My goal is to get the user's (Office 365 and Outlook.com) meetings for a given day in a WPF C# project. Following the steps described in the Outlook Dev Center Tutorial, the second step (after registering the app) would be to authenticate the user using OAuth2. But I cannot make it work:

  • I did not find any tutorial/code snippet which I was able to run. They are all written either for Apps or Asp.Net (or something else). I tried to adapt these, but without success...
  • I installed the Active Directory Authentication Library (ADAL) and Microsoft Office 365 Mail, Calendar and Contacts Library via Nuget.
  • I also don't want to use an Azure subscription, just to read some meetings. And I think it's also not necessary for my purpose as they say it's only important for advanced management.
  • When I try to obtain a token with the credentials which I got from the Application Registration Portal, I get: Application '<id>' is not supported for this API version.. Looking the error up on StackOverflow tells me to register the application, which is what I did.
  • When I try to obtain a token with the credentials from the Office App Registration Portal, I get: Application with identifier '<id>' was not found in the directory outlook.office365.com.
  • Documentation is really confusing to me, with many different APIs (Graph API, 365 API, etc.) and many dead pages in the documentation...

I'd really appreciate any pointers towards my goal.

1 Answer 1

2

If you want to be able to get items from Outlook.com as well as O365 outlook, you should use the new v2.0 app model. You will find useful documentation here : https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-app-registration/

You should read the limitations here: http://azure.microsoft.com/documentation/articles/active-directory-v2-limitations/

While you can use any Microsoft account to register applications, not all Microsoft accounts have been enabled for the REST APIs. To request an Outlook.com developer preview account with the REST APIs enabled, send an email at [email protected]

Finally if you want a sample to log in within a desktop application, check this tutorial : https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-devquickstarts-wpf/

2
  • I agree with Sebastien: you should look at the v2 app model. It is much simpler to implement, and you don't need an Azure subscription. That last link should be helpful in getting the auth piece running. Commented Dec 8, 2015 at 13:22
  • Thank you very much for your comment. This tutorial indeed helped a lot. Authentication and getting a token works now. However, I get a server error (Constructor of the OData.Web.HttpHandler is not found). As this is not related to authenticating, I created a new question here: stackoverflow.com/questions/34163445/…
    – casaout
    Commented Dec 8, 2015 at 18:37

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.