Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC4 Google oAuth

Im trying to configure Google oAuth in an MVC 4 Project. Its quite straight forward out of the box as per Hanslemans Excellent Video

Im able to register, log on, log off etc, but the only information I have is the email address. Id like to be able to get the First Name, Last Name and Image from Google

This blog outlines that it is possible - but when I run through it all that is available is the email address. This is obvious as this is all we asked for permission for.

So my question is how do I ask for more information from Google and the how do I access it. I know its possible writing my own oAuth access but I assume its possible using the out of the box MVC 4 code.

Thanks very much in advance

like image 800
Andy Marsden Avatar asked Oct 21 '22 18:10

Andy Marsden


1 Answers

I think this falls under a bug that is in DotNetOpenAuth.AspNet version="4.0.3.12153" package. You need to write your own customer provider and then you can get the data from that

http://blogs.msdn.com/b/pranav_rastogi/archive/2012/08/23/plugging-custom-oauth-openid-providers.aspx

You should be able to use GetExtraData to get the data you are looking for!

like image 112
Slick86 Avatar answered Oct 29 '22 20:10

Slick86