Live does not return Refresh_token

In the Token_Auth no refresh_token is returned.  So The Auth expires after an hour:


{"token_type":"bearer","expires_in":3600,"scope":"wl.basic wl.calendars wl.calendars_update","access_token":"EwBwAq1DB ....

I found this on the internet
http://msdn.microsoft.com/en-us/library/cc287643.aspx

Note:
This topic describes functionality that will be obsolete. This functionality is provided only to support legacy applications. Live Connect incorporates features that provide equivalent functionality.

Does this mean that we cannot get a refresh_token for Live Calendar?

Eddy Maes

Hi,


The TAdvLiveCalendar does support the use of a refresh token.
The refresh token is included in the response from the server as you can see below.
I'm not sure why there wouldn't be a refresh token included in your case?

{
  • "token_type":"bearer",
  • "expires_in":3600,
  • "scope":"wl.basic wl.calendars wl.calendars_update wl.contacts_create wl.contacts_birthday wl.birthday wl.emails wl.signin wl.offline_access wl.skydrive wl.skydrive_update wl.work_profile wl.postal_addresses wl.phone_numbers wl.contacts_photos wl.contacts_skydrive wl.photos",
  • "access_token":"xxx",
  • "refresh_token":"yyy",
  • "authentication_token":"zzz",
  • "user_id":"123"
}
I tried again and get this

{"token_type":"bearer",
"expires_in":3600,
"scope":"wl.basic wl.calendars wl.calendars_update",
"access_token":"xxx",
"user_id":"yyy"}


XXX is a token of 832 characters wide!!!  (no refresh_token in the string)
YYY is 32 characters wide

The connection works normal but needs to be autorised again when not used for 1 hour.
:-(

Eddy

An extra scope (wl.offline_acess) is required to retrieve a refresh token for Live Calendar, .
You can add the extra scope in your application code before authentication is started.

Example:
  AdvLiveCalendar1.Scopes.Add('wl.offline_access');

Problem solved!


Thanks

Eddy