oauth on Cordova/Ionic without the popup?

201 views
Skip to first unread message

mza

unread,
Apr 27, 2015, 2:15:41 PM4/27/15
to fireba...@googlegroups.com
Currently I'm using authWithOAuthPopup to allow to authenticate within my ionic app. I am able to automatically authenticate the user, but I don't know how to prevent the popup from showing. The authentication takes place so fast that all the user can see is a blank window that appears and disappears with no context as to what's happening. I would prefer to not show this window, but I don't know how to do it since it's a popup. Has anyone been able to achieve automated authentication for the user in a cordova app without a popup?

mza

unread,
Apr 27, 2015, 3:02:52 PM4/27/15
to fireba...@googlegroups.com
I've been experimenting with $authWithOAuthToken this evening which is part of AngularFire. I think this might be the route to go?

Rob DiMarco

unread,
Apr 27, 2015, 9:33:06 PM4/27/15
to fireba...@googlegroups.com
Hi Mario -

As far as I know, this is not currently possible with our existing client libraries. While the pop-up is short-lived and automatically closes without user interaction, it is actually redirecting between Firebase and the OAuth provider, and back, to restore the OAuth session and authenticate the user. In that sense, this "reauthorization" needs to take place given the current client implementation.

In the future we're hoping to add automatic OAuth session restoration, such that clients can silently re-authenticate without having to launch user-facing UI. However, this is a significant undertaking on our end and requires server support, so that feature is a ways out.

The current workaround would be to manage the OAuth sessions yourself, either with your own server process or the OAuth provider directly in such a way that the OAuth flows is managed and automatically refreshed periodically, and simply authenticate to Firebase using the OAuth token - using the `authWithOAuthToken(<provider>, <token>)` method that you called out.

Thanks -

Rob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/a3aaf27f-dc80-47ce-bd92-4aef7eafc56b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages