WebSecurity::RequireUser Method (String)
If the current user does not match the specified user name, sets the HTTP status to 401 (Unauthorized).
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
The SimpleMembershipProvider::Initialize(String, NameValueCollection) method was not called.
The InitializeDatabaseConnection() method was not called.
The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.
This method verifies that the current user is the specified user. If the current user is not the specified user, the HTTP status is set to 401 (Unauthorized).
This method will let only the specified user access the web page. The recommended way to restrict access to a web page is to create a role, and then use the RequireRoles(array<String>) method to verify that the current user is a member of that role.