我有一个网站设置接受Twitter和Facebook外部登录。
有没有办法使用声明获取推特个人资料图片?
var twitter = new TwitterAuthenticationOptions
{
ConsumerKey = AuthenticationSettings.Twitter.ConsumerKey,
ConsumerSecret = AuthenticationSettings.Twitter.ConsumerSecret,
AuthenticationType = Constants.ExternalProviders.Twitter,
SignInAsAuthenticationType = DefaultAuthenticationTypes.ExternalCookie,
Provider = new TwitterAuthenticationProvider()
{
OnAuthenticated = async ctx =>
{
//SOME CODE HERE TO GET PROFILE PHOTO
}
}
};
否则,获取个人资料照片的最佳方式是什么?
答案 0 :(得分:0)
显然没有一种简单的方法可以做到这一点,你需要使用Twitter Api。
Look here, get-the-twitter-profile-image-using-the-asp-net-identity