I was following this tutorial at http://www.codeproject.com/Articles/380900/WCF-Authentication-and-Authorization-in-Enterprise
Now I have it logging in and everything, no problems infact it works just like it should. I've even added some cryptography to it using MD5 hashing. But I'm not sure how to get the users information. So when they call the Utility service, how would I query the database for that specific user?
[PrincipalPermission(SecurityAction.Demand, Role = "Read")]
public Data.UserProfiles ViewProfile()
{
using (var context = new DatabaseEntities())
{
var user = context.UserProfiles.SingleOrDefault(u => u.UserName == ???)
return user;
}
}