How to get google plus profile picture in c# MVC authentication

后端 未结 3 649
梦谈多话
梦谈多话 2020-12-24 15:10

I\'m developing a C# ASP.NET MVC 5 application that uses Google sign in as a default provider. The login functionality works ok and I can get the e-mail and name of the user

3条回答
  •  伪装坚强ぢ
    2020-12-24 15:50

    The "image" is no longer valid, nor "url". Right now you just need to get

    context.User["picture"].ToString()
    

    Tested on .NET Core 2.2 with IdentityServer4. Maybe it's related to the latest shutdown of the Google+ API.

提交回复
热议问题