Create an Administrator Account for your application¶
When a new application is created, there are no users in the database. To open forms that need a signed-in user, or specific permissions, you first create an administrator. This guide shows how.
Info
This guide applies to applications that use Forms Authentication. If your application uses OS Authentication, read Enabling the first administrator instead. The template includes a separate form for that case, described at the end of this page.
The CreateAdmin form¶
Every application created from the Web Application template contains a form named CreateAdmin. In the Project Explorer it is under Forms, in the APP_Security Management folder.
The form is titled Administrator User Setup and has four fields: Username, Password, Repeat Password and Email.
In the Controller it has three actions: Index, the entry point that opens the form, Create, which creates the user, and AuthorizeAccess. The entry point is available to anonymous users, which is why it can be opened before anyone exists.
Warning
You are free to delete or change this form, and the application will still run. Do so only if you know what you are doing, because the first administrator can no longer be created without it.
Create the administrator after the first build¶
Build your application and open the build console. It shows an information message with a link to the CreateAdmin form. Follow the link.
You can also:
- Open the Sign In page. If there is no administrator in the database, you are redirected to CreateAdmin.
- Type the address yourself: YourAppUrl/CreateAdmin/index.
Choose a username, an email and a password, and write them down. Enter the password twice, then create the account. You can now sign in with administrator permissions.
Warning
The form is not available once at least one user has the Administrator role. If you must remove every administrator, you have to edit the database yourself.
Applications with OS authentication¶
With OS authentication nobody types a password, because the operating system supplies the identity. The template includes a different form for this, FirstAdminSetup, in the APP_Default Pages folder. It says: By clicking the OK button, "Administrator" Role will be assigned to you. This functionality cannot be used again.
The person who opens it first, signed in to Windows, becomes the administrator. Read OS Authentication before you use it.



