We are using parse.com sdk in our xamarin mobile app to authenticate our users. After the user logs in, we would like to store the session token in the local secured storage to log him automatically when he uses the app next time. However, in parse.com sdk for Xamarin, the session token on ParseUser class is not exposed. How can one get the session token? Or is there an alternate way to cache authentication details locally?
1 Answer
This website talks about how they are updating their sessions : http://blog.parse.com/announcements/announcing-enhanced-sessions/
Right here they talk about how to upgrade you application to use the new sessions: https://parse.com/tutorials/session-migration-tutorial
Basically you need to set: ParseUser.EnableRevocableSessionAsync(); right after you initialize your ParseClient, in the global asax in .net probably.
Then you can do this:
var session = await ParseSession.GetCurrentSessionAsync(); var token = session.SessionToken;
From then on you can use the following to get the user: await ParseUser.becomeAsync("session-token-here");