Why new fb api 2.4 returns null email on MVC 5 with Identity and oauth 2?

Taken from a Katana Thread I devised the following: Change the FacebookAuthenticationOptions to include BackchannelHttpHandler and UserInformationEndpoint as seen below. Make sure to include the names of the fields you want and need for your implementation. var facebookOptions = new FacebookAuthenticationOptions() { AppId = “*”, AppSecret = “*”, BackchannelHttpHandler = new FacebookBackChannelHandler(), UserInformationEndpoint = “https://graph.facebook.com/v2.4/me?fields=id,name,email,first_name,last_name” … Read more

MVC 5 How to define Owin LoginPath with localized routes

I exactly had the same problem and figured out a way to overcome this limitation. In the CookieAuthenticationOptions options, there is a “Provider” property which is initialized with the CookieAuthenticationProvider. This implements a method called ApplyRedirect and a delegate OnApplyRedirect. My first idea was to overwrite this ApplyRedirect and implement the required logic to handle … Read more

Razor syntax highlighting not working in VS 2012 with MVC 5

Microsoft released a new version of ASP.NET Web Tools for VS 2012. After installing syntax highlighting is back again. http://blogs.msdn.com/b/webdev/archive/2013/11/18/announcing-release-of-asp-net-and-web-tools-2013-1-for-visual-studio-2012.aspx Installing VS 2012 Update 4 was not enough. A set of offline installers is available. The offline installers are easier to use than the Web Platform Tools invoker (WebNode11Pack.exe @ ~114KB): If you want an … Read more

Get UserID of logged-in user in Asp.Net MVC 5

The answer is right there in your code. What does this return? var userID = User.Identity.GetUserId(); If you are using ASP.NET Identity, then after logging in (and redirecting to another page), the IPrincipal.IIdentity should be a ClaimsIdentity. You can try this: var claimsIdentity = User.Identity as ClaimsIdentity; if (claimsIdentity != null) { // the principal … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)