Working with Re-authentication with AccountManager in a large Android app

I am using AccountManager in a fairly large Android app and I am using Retrofit and Otto to handle REST requests. When the user token no longer works, the 401 error goes back to my REST handler.

I would like the REST handler to be able to show the login activity, but since it is not active, it cannot start the getAuthToken process. My next thought is to send a message back to the calling activity using Otto to inform him that the auth token is no longer working, then trigger that process, which seems to work, but I have a few things to do, and it doesn't seem like getting it right by handling what is widely applied at the activity level.

How do other people deal with it? Are you just breaking the re-authentication code that might be required to re-authenticate the user?

+3


source to share





All Articles