How to Get the ID of the logged in user in asp.net mvc web api apicontroller - Digital Tool Factory blog How to Get the ID of the logged in user in asp.net mvc web api apicontroller - Digital Tool Factory blog

How to Get the ID of the logged in user in asp.net mvc web api apicontroller

After much googling, and evening Bing-ing revealed nothing I discovered that for some reason I had the line

config.SuppressDefaultHostAuthentication();

In my WebAPIConfig.cs file – I removed that and everything magically worked and I could use User.Identity.GetUserId();

 

Written By Steve French

 

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.