问题描述
我在使用Android和iOS环境的Worklight应用程序中实现社交身份验证(使用Google,Facebook)时遇到了困难.
I am facing difficulties implementing social authentication (using Google, Facebook) in a Worklight app with the Android and iOS environments.
我正在尝试使用oauth.以下是要求:
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';
经过身份验证后,应将其重定向到我们的应用程序(位于公共领域).为此,我们必须将重定向uri添加到Google API.
After authentication it should be redirected to our app (is located in public domain). For that we have to add a redirect uri to Google API.
我不知道在REDIRECT
中应该放什么.
I don't know what should be put in REDIRECT
.
推荐答案
在普通应用程序中,混合应用程序将无法正常运行,因为您的应用程序没有公共URL.
The normal cycle will not work in a Hybrid application because your app does not have a public URL.
以下是一个记录了他做类似事情的经历的人: http://www.itsalif.info/content/oauth -google-api-gapi-phonegap-childbrowser-jquery
Here is one person who documented his experience doing something similar:http://www.itsalif.info/content/oauth-google-api-gapi-phonegap-childbrowser-jquery
也: https://github.com/andreassolberg/jso/blob/master/README -Phonegap.md
还有一个twitter/android示例: http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt5p1
Also a twitter/android example: http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt5p1
这篇关于IBM Worklight-如何在混合应用程序中使用Google认证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!