samedi 29 novembre 2014

hello.js: what to do with the redirect uri


I'm developing a Backbone/Marionette Javascript application and I want to use hello.js to manage authentication via social media.


I have some trouble that may seem pretty obvious for you, but I can't figure it out.



hello('facebook').login({
scope: 'email', redirect_uri:"fb-redirect"}, function(auth){ console.log(auth) }, function( e ){
alert("Signin error: " + e.error.message );
});


By executing the standard login method, I get redirected to a page in a popup that I defined after having provided the necessary authorisations.

But I don't understand what I'm supposed to do with the redirect, I don't understand why I need it.

When closing the redirect popup, it mentions that the login was cancelled.


I just want to receive an access_token back from the Facebook server and the basic user data such as email, first name, last name, etc...


Could you clarify this for me? Thanks.





Aucun commentaire:

Enregistrer un commentaire