---
title: Configuring forms authentication
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

With forms authentication, the application stores user names and passwords in the database and requires users to register to your site before they can log in. Forms authentication is the default option in Kentico.

To allow users to register and log in on your live site, you need to add the following [web parts](https://docs.kentico.com/k11/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md) onto your site:

- **Registration form** (see [Using the Registration form and Custom registration form web parts](https://docs.kentico.com/k11/managing-users/user-registration-and-authentication/configuring-forms-authentication/using-the-registration-form-and-custom-registration-form-web-parts.md))
- **Logon form** or **Logon mini form** (allows existing users to log in)
- **Sign out button** (allows users to log out, typically placed inside the content of the site's [master page](https://docs.kentico.com/k11/developing-websites/developing-websites-using-the-portal-engine/creating-portal-engine-master-pages.md))

## Configuring forms authentication for multiple web projects

The forms authentication uses standard ASP.NET forms authentication and its settings, which you can find in your application's **web.config** file:

```html

<system.web>
 ...
   <authentication mode="Forms">
     <forms loginUrl="CMSPages/logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="60000" slidingExpiration="true" />
   </authentication>
 ...
<system.web>

```

If you're running multiple web projects in virtual directories, and the projects have the same machine key defined, users logging in to one of the websites will be automatically logged in to sites running on other projects. To prevent that, add the **path** parameter to the above code in each project, as in the following example:

```html

<authentication mode="Forms">
   <forms loginUrl="CMSPages/logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="60000" slidingExpiration="true" path="Kentico" />
</authentication>

```

Additional configuration options related to user passwords may also be defined in the system, as described in the [Securing user accounts and passwords](https://docs.kentico.com/k11/securing-websites/designing-secure-websites/securing-user-accounts-and-passwords.md).
