Azure Mobile Service with Facebook Auth: Get user info

前端 未结 1 380
温柔的废话
温柔的废话 2021-01-16 20:42

I am new to using Azure Mobile Services (or any mobile dev). I\'ve followed this tutorial to enable Facebook authentication for an Android app. http://azure.microsoft.com/en

1条回答
  •  [愿得一人]
    2021-01-16 21:20

    Seems like my suspicion about the token was correct. This seems to work..

               var serviceUser = this.User as ServiceUser;
               var identities = await serviceUser.GetIdentitiesAsync();
               var fb = identities.OfType().FirstOrDefault();
    
               var client = new FacebookClient(fb.AccessToken);
               dynamic me = client.Get("me", new { fields = "name,id" });
               string firstName = me.name;
               string lastName = me.last_name;
    

    0 讨论(0)
提交回复
热议问题