[Aerogear-users] OAuth2 session doesn't persist in iOS

Michael Doo michael at 410labs.com
Wed Dec 2 18:24:41 EST 2015


Hello,

When integrating the Aerogear iOS OAuth2 library, I'm adding an account
like so:

let googleModule = AccountManager.addGoogleAccount(googleConfig)

In the current session, I can then make calls like

let module = AccountManager.getAccountByName("my_custom_account_name")

and retrieve the module to call requestAccess() on and go on with my day.
However, if I stop the app or restart the device, the following calls to
getAccountByName() returns nil, even when given the same account ID. From
the documentation, it's unclear how to persist accounts in the account
manager across sessions. Do I need to resurrect the session somehow or
reinstantiate it? Or am I missing how AccountManager interacts with the
TrustedPersistantOAuth2Session? My goal is to simply be able to authorize
multiple Gmail accounts and refresh their access tokens when needed. The
AccountManager seemed a good way to do this, but I could be mistaken.

Best,
Michael Doo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-users/attachments/20151202/dd7e0fdd/attachment.html 


More information about the Aerogear-users mailing list