I have a problem with Facebook login. When I use
var accessToken = "XXXXXXXXXX";
Everlive.Users.loginWithFacebook(accessToken,
function (data) {
//code
},
function (error) {
//code
});
I get this error:
message: "Cannot retrieve a user for the specified token.", code: 217
accessToken is correct because I don't have any problem when I use FB API for login.
Facebook is enabled in telerik platform and.
Do you have any suggestions?
5 Answers, 1 is accepted
This error is explained here - http://docs.telerik.com/platform/backend-services/development/rest-api/error_codes. It is usually returned when the token passed as Facebook token is not a valid one before the FB API. As you can see in this article the backend server will try to reach the FB API with the provided token and verify the user's identity. If this step fails the above error is returned to the client.
Could you please double check the token and its format, perhaps the data might be truncated or the token might be expired. Otherwise, you should not experience such error.
Also, could you trace the request sent to the server and the data in it? It should be a POST request to the /Users endpoint with the following body:
{
"Identity": {
"Provider": "Facebook",
"Token": "your-facebook-token-here"
}
}
where your-facebook-token-here is the actual FB token. Examining the request may shed some light on the issue.
Let me know if further questions arise.
Regards,
Anton Dobrev
Telerik

Tocken is OK. I have a same problem with Twitter.
I tried to investigate the issue on our side but to no avail.
Could you please observe the body of the request sent to the server that returns the error?
Optionally, we will appreciate if you could share a sample code that reproduces the issue, no need to include the Facebook App Id and API key. Also, the settings of your FB app would be helpful. You may also share this information in a private support ticket.
I look forward to your reply.
Regards,
Anton Dobrev
Telerik

this is requests for FB i Twitter
this is my code
var accessToken = "XXXXXXXXXX";
Everlive.Users.loginWithFacebook(accessToken,
function (data) {
console.log(data);
},
function (error) {
console.log(error);
});
Thanks for providing this information.
Indeed, the request made to the API seems correct. What it appears to be a concern is that both the FB and Twitter tokens appear to be very short in terms of length (I do understand that you edited the body of the token). This leads me to believe, that the token was not properly obtained hence the error.
We'd like to ask you to:
- Check your Facebook app with the Friends sample application. To do this, just map the values in the FB settings in app/settings.js with your FB APP ID.
- Test the Twitter authentication - use the Access Token and Access Token secret for your app located under the https://apps.twitter.com/ settings and call el.Users.loginWithTwitter(accessToken, tokenSecret, cb, ecb); with this hard-coded parameters.
The above steps are needed in order to ensure that the API for social login of users works properly for you.
I am afraid that until we are able to reproduce the issue locally we could not be of any further guidance. That is why I'd suggest that you submit a private support ticket (under the Almir Music account) and provide a runnable sample that illustrates the issue. The crucial in this case would be to scrutinize the logic that obtains a token on behalf the user after the user consent is granted.
I look forward to your reply.
Regards,
Anton Dobrev
Telerik