liveservices/LiveSDK-for-iOS

How to persist the live connect session?

Opened this issue · 3 comments

Every time I restart the simulator I have to login again because the LiveConnectSession session will be nil. Is there any way to persist the session to keychain? like google oauth sdk does?

aclev commented

Hi @izon90
The LiveConnectClient will persist the information automatically if there was a refresh token. To get a refresh token you must be using the correct scopes when you authenticate. wl.offline_access will grant you permission for a refresh token.

I have added wl.offline_access to scopes. and I do a login again. But when I try to NSLog LiveConnectClient session it's nill. Right now, I am manually save the session info to keychain and then read it back then init a new session and use this session to make http request, and it worked. Maybe the livesdk will support this feature in the future?

aclev commented

As I mentioned above the LiveConectClient should store the refresh token and auto refresh for you. I have not been able to reproduce the issue. Could you show me how you are creating/storing the LiveConnectClient object?