BOXContentClient logout
is their a specific method to logout - when using the appuser - instantiating a client using Server-to-Server auth. i am doing if let boxContentClientDefault = BOXContentClient.default() { boxContentClientDefault.logOut() } But this doesn't seem to logout the appuser . Is their anything i am missing in logout.
My boxsdk instantiation is : boxContentClient = BOXContentClient(for: authUser, initialToken: nil, fetchTokenBlockInfo: nil, fetchTokenBlock: fetchToken)!
@mattwiller - Could you help with this issue . I tried boxContentClientDefault.logOut(), tried with the instance.logout and the static method - BOXContentClient.logoutall()
None of them seem to work
@ManasaMS85 The default client and the client you instantiate are different — calling .logOut() on the default client will not log out your client. If you created the client like boxContentClient = BOXContentClient(for: authUser, initialToken: nil, fetchTokenBlockInfo: nil, fetchTokenBlock: fetchToken)!, you'll want to call boxContentClient.logOut() instead. That should revoke the access token being used and cancel any in-flight operations.
boxContentClient.logOut() also doesnot work - as the connected SDK instance is corrupted . We have sample app which we did for login and logout and we were able to see the sdk instance gets corrected . thats the same reason we have "unable to load image " issue as well.
Steps to reproduce
- Logout the app
- login the app
- Open box preview
- Logout again - the logout fails
@ManasaMS85 I'm able to reproduce the issue as you describe (thank you for the sample app!), and I'm in the process of investigating the issue. In the meantime, I think it's likely that the issue might be due to your re-use of a single shared boxContentClient instance. Could you try instantiating a new client using BOXContentClient(for: authUser, initialToken: nil, fetchTokenBlockInfo: nil, fetchTokenBlock: fetchToken) for each login instead of trying to re-authenticate the same client after it has been logged out?
@mattwiller - For each new login i have been instantiating a new client - But unfortunately the previous logout does not work - this new instantiation does not seem to work perfectly.
When i create a new instance of the client - unable to load image issue is resolved
@ManasaMS85 Can you explain a bit more what you mean by "the previous logout does not work"? In your sample app, it does not appear that you're instantiating a new client at login — the code is re-authenticating the same client instance.
If creating a new instance of the client resolves your issue, is that an acceptable solution to this issue?
@ManasaMS85 Are you still running into this issue?
This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.
This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box iOS SDK and feel free to open another PR/issue at any time.