title: Is there a simple way to authenticate WPF Desktop application with Office 365 API?
body: <p>I want to create simple WPF desktop or console application which retrieves and shows data from Office 365 Contacts API.</p>
  
  <p>I already have an Azure AD and an Office 365 accounts. I've read the documentation and seen a lot of samples. But they were all about ASP.NET and windows 8.1 and other types of application.
  They used OWIN or build-in authentication calls(for windows 8.1).</p>
  
  <p>I think it should look like this:</p>
  
  <ol>
  <li>User presses the button</li>
  <li>My application calls a method from "some Microsoft library" and passes as
  client_id a parameter. This call will open a new browser window with
  suggestion for user to login. User logs in and agrees to provide access to  his contacts.</li>
  <li>As result of this call I should receive an access token</li>
  <li>Be happy and read contacts by using
  Microsoft.Ofiice365.OutlookServices.</li>
  </ol>
  
  <p>I'm stuck at the second point of this idea - "some Microsoft library".
  Can you suggest which library I should use?
  Does something like this exist?</p>
  
  <p>If it would not work in this way, can you suggest any other way to retrieve contacts from office 365 in WPF desktop or console application?</p>
  
  <p>I'm trying to find something that is <a href="https://msdn.microsoft.com/EN-US/library/office/dn631817.aspx" rel="nofollow">like this,</a> but works wiht contacts API (not with One Drive) and does not require me to define special BrowserWindow in XAML or C#.
  Does this way exist?  Or I should implement this functionality by myself?</p>
  
  <p>Additionally I would like to use Office 365 REST API, not EWS.</p>