Following this blog and this answer, I'm obtaining the user's name (which seems to be the correct one). However, when I make the call as follows, I get null.
MembershipUser uno = Membership.GetUser(); //null
MembershipUser duo = Membership.GetUser(User.Identity.Name); // null
bool tri = User.Identity.IsAuthenticated; // true
string qua = User.Identity.AuthenticationType; // "ApplicationCookie"
The user is definitely in the DB and I used the standard registration module in the MVC.NET template. Because of the requirements elsewhere, I need to produce the actual guid and can't use the user's name.
This is a part of my Web.config, which I suspect might be of relevance. I'm not big on security issues.
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5.2" />
<customErrors mode="Off"></customErrors>
<httpRuntime targetFramework="4.5.2" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
</modules>
</system.webServer>