Closed ghost closed 9 years ago
I am really sorry for posting this question. I had missed a step in the documentation. The error was in my javascript code. While calling Oauth.popup()
, I needed to pass the state token and get a code which was then supposed to be passed to the server. I was sending the state token to the server directly instead of the code.
The correct code will be this :
var selectedAuth = 'facebook';
$.post('http://localhost/auth/v1/social', {provider: selectedAuth, get_state_token: 1}, function(data){
OAuth.popup(selectedAuth, {
state: data.token
})
.done(function(result) {
console.log(result);
$.post('http://localhost/auth/v1/social', {provider: selectedAuth, code: result.code, access_token: result.access_token}, function(data){
console.log(data);
}, 'json');
})
.fail(function (err) {
//handle error with err
});
}, 'json');
Hi, I have a javascript client and a laravel backend. I successfully got state token by calling
generateStateToken()
method, but then I send that to$this->oauth->auth()
method I get Invalid Format error. Can you please tell me what this error means and what I am doing wrong.Client Side
Server Side
--- snip ---
I have verified that
$code
does have the exact state token that I have received on the 1st step. The value of$credentials
is as follows:Please help me out here. This error occurs for twitter auth as well.