liveservices / LiveSDK-for-iOS

LiveSDK library for integrating with Live Connect
MIT License
138 stars 84 forks source link

How to persist the live connect session? #63

Open y0unghe opened 9 years ago

y0unghe commented 9 years ago

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 9 years ago

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.

y0unghe commented 9 years ago

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 9 years ago

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?