Once it expires, I briefly see the alert to "Sign in" and then it disappears and I get the error :"Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ()". (It works fine again if I delete the app and re-install it.) I read that I should "Ensure that there is a strong reference to the SFAuthenticationSession instance when the session is in progress.". And I think that's the case : the viewController from where I do the login has its private var authState. (see code below)