asp.net mvc - Getting the right User.Identity -
i'm having little bit of trouble mvc httpcontext.user.identity i'm getting system.security.principal.windowsidentity , it's giving me name of windows user... don't want that, want (at first) null user.identity can use formsauthentication. how can prevent mvc use system.security.principal.windowsidentity show right user.identity? appreciated
public actionresult index() { var s = httpcontext.user.identity.name; // return view(); }
in <system.web>
section of web.config file, change forms authentication.
<authentication mode="forms"> <forms loginurl="~/account/login" timeout="2880" /> </authentication>
Comments
Post a Comment