Reputation: 11
I'm using javascript sdk for user login
FB.init({appId: applicationId, status: true, cookie: true, xfbml: true, oauth: true});
FB.login(callbackFunction, {scope:permissions});
i get valid access token in authResponse, and also a signed cookie is set, which decoded has code.
according to documentation access token could be retrieved with
when i try this with the code i receive error Error validating verification code. 100
as redirect_uri i've tried uri that is set as App Domain and siteURL. these give that error. with other uri i get Invalid redirect_uri: Given URL is not permitted by the application configuration. 191
Am i here mixing client-side flow and server-side flow in bad way or should i use some redirect_uri parameter when using FB.init
or FB.login
and use that exact uri when getting access token by code?
Upvotes: 1
Views: 1084
Reputation: 451
FB.login(callbackFunction, {scope:permissions});
the callback function is sent an object
authResponse: { /* Information about the current session */
userID: "" /* String representing the current user's ID */
signedRequest: "", /* String with the current signedRequest */
expiresIn: "", /* UNIX time when the session expires */
accessToken: "", /* Access token of the user */
}
In here is the user access token that does not need to be converted by calling another URL. It's ready to go for about an hour, then you'll need to get a new one.
Upvotes: 0