Getting update token from the Windows Live SDK in a universal Windows application

I am developing a universal application for Windows (Windows 10), where I have a β€œtwo-layer” application: on IoT devices (for example, Raspberry Pi 2) it just displays content, but on all other devices (PC, laptop, Smartphone, etc. .) You have something like a controller for the displayed data.

One of the features that I want to implement is to log into Windows Live in the controller part to get calendar information in the Display-IoT-Part. To do this, I give users the ability to log into Windows Live, as shown below:

LiveAuthClient auth = new LiveAuthClient(); LiveLoginResult loginResult = await auth.LoginAsync(new string[] { "wl.signin", "wl.calendars", "wl.offline_access" }); if (loginResult.Status == LiveConnectSessionStatus.Connected) { //Save the AccessToken from loginResult.Session.AccessToken TokenHandler.Save(loginResult.Session.AccessToken); //AccessToken is quite accessable right here //But as far as I know I should save the RefreshToken, but the Session has no field for it } 

So my idea is that I do not get a field from LiveConnectSession where I can save RefreshToken , but all the articles I read say that I just need to add wl.offline_access in the area to get RefreshToken.

I am not very familiar with OAuth2.0, and the SDK / API is built on OAuth, so does someone know something that I am doing wrong or how do I need it?

I am very grateful for all the helpful and helpful answers!

PS: I use the Live SDK 5.6 and not the new OneDrive API because it does not have access to calendar information

+6
source share
1 answer

wl.offline_access

in this case, it talks about user authorization and allows the application to have the user's permission to work when he is absent (when the user is disconnected, not the computer / device).
This does not mean that the application will log into the system when the system is offline, but will ask the user to allow the application to work when the user is not present.
Even I used the Live SDK to get user data in one of my previous projects, but I had to use Office365 for the calendar. Now you can even use the Outlook API. Although we get an Access Token using loginResult.Session.AccessToken, I don’t think that refreshToken is created for the WinRT application.

+2
source

All Articles