Reputation: 17
Is this even possible? I've tried lots of solutions: oAuth2, looked at Twitter oauth examples, clientLogin... And it needs to work in Phonegap (Javascript). I'm having a hard time figuring this out and all I need is a user's email (verified). Anyone ever tried this?
Upvotes: 2
Views: 3230
Reputation: 6203
It's possible but kind of a bitch, pardon my French. First you need to register your app. I am working on integrating Google oAuth2 to an Android app, so I chose "installed app" as an option. G gave me a client id I have to pass along a bunch of other parameters, including a fake redirect uri so that the code appears in a page, both in the header and inside a .
Worst case scenario -- which is where I'm at -- if you're on a similar case as me, redirect the user to the browser to authenticate, and ask them to copy the code given back to your app. Use that thereafter.
Or, if you're smart enough to load the auth page inside your own page and get the code directly, use that.
I'll get back to you once I have this worked out.
HTH
EDIT: Alright, I've got it to work. I am going to upload a sample project on google code, look for googleoauth2phonegap in a couple of hours. http://code.google.com/p/googleoauth2phonegap/
Upvotes: 1