I am developing a cordova application with CloudBoost and it requires own login page.
I decided to use ng-cordova-oauth plugin to get the access_token from the providers. After getting the token, it is called the function to login the user in the CloudBoost system.
In every request made to login the user, it is returned : "Failed to load resource: the server responded with a status of 400 (Bad Request)" loginwithprovider (0,0).
This message is obtained after receiving the access_token from the provider.
Is it related with the format of the token?
Example of the login funcion used on facebook.
$scope.login_facebook = function ()
{
$cordovaOauth.facebook("XXX", ["email", "public_profile"]).then(function (result)
{
console.log(JSON.stringify(result));
CB.CloudUser.authenticateWithProvider({
provider: "facebook",
accessToken: result.access_token
}, {
success: function (user) {
console.log(user);
},
error: function (error) {
console.log(error);
}
});
});
}