Create an Administrator Account for your application¶
This How-To will help you create an Administrator Account for your application. When a new application is created, there are no users in the database. In order to access forms that require an authenticated user or specific user permissions, you must first go through the steps described here.
This tutorial applies to applications using Forms Authentication. If your applications uses OS Authentication please read the guide here.
Create Admin Form Model¶
All applications based on the Web Application template will include by default a Form model named "CreateAdmin" which is located in the APP_Security Management folder.
It is very simple form containing three text boxes and two controller actions. Nothing special here.
You are free to delete or modify this model, your application will run flawlessly. Of course, this is suggested for advanced users that know what they are doing.
Create the administrator after the first build¶
Build your application and open the Build Console. You will notice an information message containing a link to the CreateAdmin form. Follow the link and you will be redirected there.
Alternatively, go to the Sign In page and you will be redirected to the CreateAdmin form if there is no Administrator user in the database.
You can also navigate to this form by manually typing in the address bar: YourAppUrl/CreateAdmin/index.
Think of a username and password. Write them down or be sure that you will not forget them.
Once the first Administrator user is created, you can access the application with administrator permissions.
This form is not accessible if there is at least one user assigned with the Administrator role. You can always alter the database manually and remove any administrators in case you really know what you are doing.