IBM Worklight - How do I use Google Authentication in a hybrid application?

I'm having difficulty implementing social authentication (using Google, Facebook) in a Worklight app with Android and iOS.

I am trying to use oauth. The following are requirements:

var OAUTHURL = 'https://accounts.google.com/o/oauth2/auth?'; var VALIDURL = 'https://www.googleapis.com/oauth2/v1/tokeninfo?access_token='; var SCOPE = 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email'; var CLIENTID = '97612631714.apps.googleusercontent.com'; var REDIRECT = ?????? var LOGOUT = 'http://accounts.google.com/Logout'; 

After authentication, it should be redirected to our application (in the public domain). To do this, we need to add uri redirection to the Google API.

I do not know what should be placed in REDIRECT .

0
source share
1 answer

A normal loop will not work in a hybrid application because your application does not have a public URL.

Here is one person who documented their experience by doing something like this: http://www.itsalif.info/content/oauth-google-api-gapi-phonegap-childbrowser-jquery

also: https://github.com/andreassolberg/jso/blob/master/README-Phonegap.md

Also a twitter / android example: http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt5p1

+1
source

Source: https://habr.com/ru/post/1498911/


All Articles