After hours of googling, reading MS documentation and code samples, I am now just more confused, and in need of some architectural advice.
Basically I need to work out which APIs are applicable and how to start with them.
Background
I have an existing app (currently a XAML + c# win store 8.1 app) with a WebAPI 2.2 odata (and also some MVC pages) backend.
The client app runs nicely on Win 8.1 and win 10 machines The server side is in an azure VM.
Currently
- Users are logged into the app (as the user they are logged into windows with) using their Microsoft Account
- They do not have to type usernames / passwords, they simply accept the permissions (1x) I specify with the scopes e.g. "wl.basic", "wl.emails", "wl.calendars"
- To do this I am using the Live Connect libraries (Microsoft.Live.dll, v5.6.0.0)
- I then get an AuthenticationToken from LiveLoginResult
e.g.
_loginResult.Session.AuthenticationToken
- Which I pass up to the server along with the odata requests.
- The server uses this to find their LiveID / UserID
e.g.
LiveAuthClient authClient = new LiveAuthClient(clientId, clientSecret, redirectUrl);
string liveIdGuidAsString = authClient.GetUserId(authenticationToken);
- Which I then use to find the relevant user in my DB and serve their odata content down to the client app
All is good.
I want to extend my application to synchronize with / integrate with the user's Outlook's calendars
Seems the sensible way to do this these days would be either using
- Outlook REST APIs
- MS Graph
It also seems MS might turn off the Live APIs I am currently using at any time?
https://msdn.microsoft.com/en-us/library/hh243641.aspx
Additional Complexity
I'd also (in a couple of months time) like to extend the application to
- be X-platform (probably using Xamarin traditional with PCL code sharing and "xamarin traditional" platform specifc projects for UI, probably using MVVMCross)
- allow users to use other services for authentication (all OAuth 2.0) - e.g. google / gmail accounts
This means I'd like if possible to make things as "raw OAuth" for compatibility and NOT tie myself to any particular MS APIs (obviously the outlook / outlook.com calendar integration would only be a feature available to those users with MS accounts)
Also, some existing users have outlook.com accounts (which they use to login to windows with) but have their calendar data in Hosted Exchange 2010
Seems to access this calendar data, these users would have to either move all their outlook 2016 data into outlook.com, or be setup as office 365 accounts and have the data migrated up to the new accounts.
Questions
1. Where / with whom should I authenticate to get my authorization code and access token - MS Graph ? or Outlook REST API
I have seen this answer (i.e. basically prefer MS Graph)
2. Can I retain the awesome "no username / password, just accept permissions functionality" for my Users on Windows 8.1 and 10 using "Microsoft Accounts" ?
Certainly with MS Graph it seems my Outlook.com / Microsoft Account users would not be able to continue to login to my app based on their windows user without Username + Password?
Documentation also seems to suggest that to use that to use MS Graph my users will need to be Office 365 / Azure Active Directory so to try and minimise impact, and keep a wider audience should I use Outlook REST APIs
But then the suggested library for the Outlook REST APIs seems to be ADAL which seems to rely on Azure Active Directory? So will my existing outlook.com users not be able to use this?
3. How long do I have to replace the Live SDK and be using something else?
Basically I am baffled by the array of options and considerations and could do with any advice whatsoever as to which direction(s) to take.