You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I was looking into the [VLSessionManager loggedIn] (#25) issue, I found out that the VLSessionManager class, uses NSUserDefaults in order to save/use the user's OAuth 2.0 access token.
The following code saves the access token to the user defaults:
Obviously this is not a secure solution, you should be using Apple's built in iOS keychain, in order to safely store the access token. (Keychain takes care of the encryption for you. There are plenty of easy to use wrapper classes online, that can be used to implement keychain into Vinli).
The second problem is in relation to issue [VLSessionManager loggedIn] does NOT work #25, if the user revokes app access, the + (VLSession *) currentSession method, will still return a non null object. Thus the if statement check if ([VLSessionManager loggedIn]), thinks the user is logged in even though they aren't. Therefore the + (VLSession *) currentSession method needs to perform an online check, to see if the user has revoked access (if an access token is available locally). Check out the below example:
While I was looking into the
[VLSessionManager loggedIn]
(#25) issue, I found out that theVLSessionManager
class, usesNSUserDefaults
in order to save/use the user's OAuth 2.0 access token.The following code saves the access token to the user defaults:
And the below code checks if an access token is available:
Issues
Obviously this is not a secure solution, you should be using Apple's built in iOS keychain, in order to safely store the access token. (Keychain takes care of the encryption for you. There are plenty of easy to use wrapper classes online, that can be used to implement keychain into Vinli).
The second problem is in relation to issue [VLSessionManager loggedIn] does NOT work #25, if the user revokes app access, the
+ (VLSession *) currentSession
method, will still return a non null object. Thus the if statement checkif ([VLSessionManager loggedIn])
, thinks the user is logged in even though they aren't. Therefore the+ (VLSession *) currentSession
method needs to perform an online check, to see if the user has revoked access (if an access token is available locally). Check out the below example:The
checkAppAccountAccess
method will perform a simple POST request to the Vinli API, to find out if the user has revoked access.The text was updated successfully, but these errors were encountered: