amazon-archives / aws-sdk-unity

ARCHIVED: The aws sdk for unity is now distributed as a part of aws sdk for dotnet:
https://github.com/aws/aws-sdk-net
Other
105 stars 43 forks source link

Credentials.AddLogin not working with new FB SDK #121

Closed jdmiranda closed 8 years ago

jdmiranda commented 8 years ago

With the new facebook SDK I'm trying to add a login to my cognito. When i try the CognitoSync Demo using the old FB SDK it works. When I try in my project to use the new FB SDK it doesn't. No errors are being thrown. It just doesn't reflect inside Cognito.

        if (FB.IsLoggedIn) {
                if (AccessToken.CurrentAccessToken.TokenString != null) {
                    Credentials.AddLogin ("graph.facebook.com", AccessToken.CurrentAccessToken.TokenString);
                }
            }
madangosain commented 8 years ago

I'm using AWS unity 2.1 plugin with latest facebook-unity sdk. Facebook login works fine for me using above code as you mentioned. Assuming you have configured facebook app id in aws setting.

karthiksaligrama commented 8 years ago

Also you should do probably do


if (!string.IsNullOrEmpty(AccessToken.CurrentAccessToken.TokenString))
jdmiranda commented 8 years ago

In the debugger I can see that there are is a linked login representing graph.facebook.com with the correct Id for the correct identitypoolId. I have a node server that i verify the facebook token with and that comes back good. Inside of AWS console when I look up that user's Id it doesn't show as linked. Is there another call after credentials.AddLogin(authProvider, token); that I need to call to link the login?

jdmiranda commented 8 years ago

I even verified that I could sync just to make sure I hadn't broke that. That works fine.

jdmiranda commented 8 years ago

I finally figured it out. after getting adding the credentials you then have to touch a dataset using the new credentials and sync it for the accounts to link. That's a little unintuitive. Since i have auth separated from persistence.