I am using SF Mobile SDK version 5.2. I am only using the sdk for authentication and authorization of SF users of our organization. Once a user is authenticated from the salesforce, he can use the app.
The problem I am facing is that SF Mobile SDK caches the user session and account details and after the first time use, always shows that the user has a valid session and validates the user and provides its details. Even when I disable or freeze the user from the salesforce admin, it keep authenticating the user in the app and the change only takes effect when user logs out and then try to login again.
This is how I am authenticating the user:
if SFAuthenticationManager.shared().haveValidSession {
if let sfUser = SFUserAccountManager.sharedInstance().currentUser {
// Session is valid and sfUser is retrieved
// allow the user to use the app
}
else {
// user not present
// show the sf login screen
}
}
else {
// no valid session present
// show the sf login screen
}
I also revoked the session for a particular user in the 'Connected App OAuth Usage' section but of no use.
I want my cached session to expire (even after some time) so that my new changes can take affect and disabled or freezed users can be restricted from using the app.