0

I'm trying to get the OAuth.io system working in my app. I normally develop my apps in my browser first, and then port them over into the Android/iOS apps, using Phonegap Build. Here is the JS I'm using: (I've downloaded oauth.min.js, and am including that fine);

$('#facebook-login').click(function() {
    OAuth.initialize('xxxx_my_key_here_xxxx');
    OAuth.popup('facebook').done(function(result) {
        console.log(result)
        alert("all good");
    })
    .fail(function (err) {
        alert("oops, we got an error!");
        console.log(err);
    });

    return false;
});

I then try it from my test domain, and get:

Error: Origin "http://testdomain.com.nmsrv.com/steampunk/login.html" does not match any registered domain/url on oauth.io

Which makes sense, as I had to set the domain to yours:

enter image description here

If I convert it into a "proper" app, and then try running in an emulator, I get this error:

enter image description here

Is there no way I can run this both as a web-app (for developing), and also in the phonegap app? (I can't get either working yet - which is annoying - as I've spent most the day on it)

UPDATE: Ok, so I found the "Domains & URLs whitelist", and added my test domain in there -all good now - I get a correct response back. However that won't work on the app itself, as file:// would be the referrer. What would I put there?

4

1 回答 1

0

正如您所提到的,您需要testdomain.com.nmsrv.com在 OAuth.io 仪表板中将您的域列入白名单,以在浏览器中测试授权。对于移动 SDK(Phonegap、iOS、Android),您不需要将 file:/// 列入白名单,OAuth.io 会为您处理。

于 2015-01-23T19:38:02.553 回答