我已经开始和关闭了几个月的hello.js来使用我的PhoneGap应用程序.
现在只关注Google,当我在PhoneGap浏览器中重定向时,我发送了400错误;
Error: invalid_request
invalid parameter for redirect_uri: Missing authority
file:///android_asset/www/index.html
Run Code Online (Sandbox Code Playgroud)
我已经按照各种网站上的说明来帮助设置,但似乎没有什么能让我超越这个错误.
我的按钮:
<button onclick="hello( 'google' ).login()">google</button>
Run Code Online (Sandbox Code Playgroud)
我的javascript:
<script type="text/javascript" src="js/hello.all.js"></script>
<script>
hello.on('auth.login', function(auth){
// call user information, for the given network
hello( auth.network ).api( '/me' ).success(function(r){
var $target = $("#profile_"+ auth.network );
if($target.length==0){
$target = $("<div id='profile_"+auth.network+"'></div>").appendTo("#profile");
}
$target.html('<img src="'+ r.thumbnail +'" /> Hey '+r.name).attr('title', r.name + " on "+ auth.network);
});
});
hello.init({
google : 'MY_CLIENT_ID_IS_HERE.apps.googleusercontent.com'
},{redirect_uri:'TRIED_VARIOUS_THINGS_HERE'});
</script>
Run Code Online (Sandbox Code Playgroud)
我已经尝试了http:// localhost的重定向网址(没有空格,因为它在这里)我尝试了一个urn的重定向网址:ietf:wg:oauth:2.0:oob我尝试了一个仅重定向网址OOB
谷歌说我的重定向URIS是
REDIRECT URIS
urn:ietf:wg:oauth:2.0:oob
http://localhost
Run Code Online (Sandbox Code Playgroud)
在与Andrew Dodson交谈时,我认为他是hello.js的创造者,他说:
Its …Run Code Online (Sandbox Code Playgroud)