This is a migrated thread and some comments may be shown as answers.

Everlive (login with facebook)

5 Answers 148 Views
JavaScript SDK
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Predrag
Top achievements
Rank 1
Predrag asked on 09 Apr 2015, 12:21 PM

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

Sort by
0
Anton Dobrev
Telerik team
answered on 09 Apr 2015, 03:50 PM
Hi Predrag,

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
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
0
Almir
Top achievements
Rank 1
answered on 11 Apr 2015, 06:47 PM

Tocken is OK. I have a same problem with Twitter.

0
Anton Dobrev
Telerik team
answered on 14 Apr 2015, 03:32 PM
Hi,

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
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
0
Predrag
Top achievements
Rank 1
answered on 20 Apr 2015, 12:28 PM

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);
                });

0
Anton Dobrev
Telerik team
answered on 23 Apr 2015, 08:57 AM
Hi Predrag,

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
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
JavaScript SDK
Asked by
Predrag
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Almir
Top achievements
Rank 1
Predrag
Top achievements
Rank 1
Share this question
or