Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The call is correct. The <code>User.Identity.Name</code> is filled out by whatever authentication provider is in use - Windows authentication, Forms authentication, some custom authentication provider, or whatever. It isn't bound to a specific user "type". The authentication provider has the responsibility of making sure the <code>Identity</code> object corresponds to the current user on every request. Usually that part is taken care of using a combination of cookies and database.</p> <p>The MVC template (although I haven't had a look at the template since MVC 2) uses ASP.NET's <code>Membership</code> class, which in turn uses a membership provider - for example <code>SqlMembershipProvider</code> or <code>ActiveDirectoryMembershipProvider</code> - the former stores your users' credentials (username and password etc.) in an SQL Server database, the latter uses Active Directory (i.e. primarily Windows logons). <code>SqlMembershipProvider</code> is the default, and MVC is set up to use a local SQLExpress database file as its user store.</p> <p>The authentication provider that's implemented in the template project uses <code>FormsAuthentication</code>, which does the login procedure through a simple HTML form (the one in the <code>LogOn</code> view) and keeps the user signed in by way of an encrypted cookie. Works on any platform.</p> <p>The setup for both FormsAuthentication and SqlMembershipProvider can be found in web.config (the one in the root of the site). There you can find the connection strings for the SQLExpress database (and e.g. change them to use a "real" SQL Server if needed), the timeout for logins etc.</p> <p>(Note that you can do a lot of that configuration easily in a GUI through the "ASP.NET Configuration" button in the toolbar of Solution Explorer in Visual Studio - it also provides an easy way to set up the first users).</p> <p>In short, it's all ready to go - and doesn't lock out non-Windows users.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload