---
title: Adding a secured section for partners
---

> 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).

Kentico provides a way to create secured site sections that can only be viewed by users who have a valid user name and password. This page describes how to create a logon web page for the purposes of user authentication and registration, as well as a secured page accessible only by logged in users.

## Adding the secured partners page

Start by adding a new secured page that requires authentication:

1. Open the **Pages** application and select the root of the content tree (**My website**).
2. Click **New** ()**.**
3. Choose the **Page (menu item)** document type.
4. Type _**Partners**_ as the **Page name** and choose the **Use existing page template** option. Select the **Templates with editable regions** category and the **Simple text** page template.
5. Click **Save** to create the page.
6. On the **Page** tab, type the following text into the editable region: _This is a secured page for partners._
7. Click **Save**.
8. Open the **Properties -> Security** tab of the **Partners** document.
9. Select _**Yes**_ for the **Requires authentication** property in the **Access** section
10. Click **Save**.

This ensures that only authenticated (logged in) users can access the page.

## Creating the logon page

Now build a page where users can sign in to the website and anonymous visitors can register as new users. Use a predefined page template, which you can further customize as needed.

1. In the **Pages** application, select the root of the content tree (**My website**).
2. Click **New** ().
3. Choose the **Page (menu item)** document type.
4. Type _**Logon**_ as the **Page name** and choose the **Use existing page template** option. Select the **Membership and security** category and the **Log-on page with registration form** page template.
5. Click **Save** to create the page.
6. Drag the Logon page to the end of the content tree.
7. Open the **Properties -> Navigation** tab.
8. Clear the **Show in navigation** and **Show in sitemap** check boxes.
9. Click **Save**.

Because of the document's navigation settings, the Logon page does not show up in the website's menu. You can use this configuration for pages that have a special purpose on the website, but are not part of the regular content.

## Setting the website's logon page

When an anonymous visitor attempts to access a secured page that requires authentication (such as the _Partners_ page on your sample website), the system redirects them to a logon page. By default, websites use the system page that appears when signing into the Kentico administration interface. However, you can configure each website to use its own custom logon page.

1. Open the **Settings** application.
2. Select the **Security & Membership** category in the settings tree.
3. Select **My website** in the **Site** drop-down menu.
4. Clear the **Inherit from global settings** check box next to the **Website logon page URL** setting and type in _**\~/Logon.aspx**_. This is the relative URL of the logon page that you added to the website.
5. Click **Save**.

The website's logon page is now ready.

## Adding a sign out button to the website

The website now allows users to log in, so you should also provide a way to log out. You can do this by adding the appropriate web parts to the website's master page.

1. Open the **Pages** application.
2. Select the root of the content tree (**My website**).
3. Switch to the **Design** tab.
4. Add the following web parts to the **zoneMain** web part zone and set their properties:\
   **Current user**

   - **Content before**: **Sign out button**

   - **Content after**:&#x20;

> **Info:** The **** tag encloses the Current user and Sign out button web parts and floats them to the right side of the page.

5. Set the following order for the web parts in **zoneMain** (you can drag web parts using your mouse):
   1. Current user
   2. Sign out button
   3. Page placeholder

The **Sign out** button and the web part showing the current user's name are now visible for signed in users on all pages on the website.

![Adding the Sign out button to the master page](https://docs.kentico.com/docsassets/k8tutorial/adding-a-secured-section-for-partners/Master_Logoff_Design.png "Adding the Sign out button to the master page")

## Result - Logging in to the website

Now that you have added the logon page, secured section and sign out button to the website, you can test the new functionality from the perspective of a live site user.

1. Open the user menu on the right of the Kentico administration interface header, and select **Sign Out**.
2. Click **Partners** in the main menu. The page is restricted, so the website redirects you to the logon page.
3. Log in as the administrator again or try registering a new account. After you sign in successfully, the site automatically redirects you back to the **Partners** page.

![Viewing the secured section of the website](https://docs.kentico.com/docsassets/k8tutorial/adding-a-secured-section-for-partners/Secured_Section_Result.png "Viewing the secured section of the website")

Here you can see the content of the secured page, as well as the name of the current user and the **Sign Out** button.

> **Tip:** Kentico also allows you to display content according to the _read_ permissions of users. For example, you can grant the Read permission for a Gold partners section to members of the Gold partners role, so that only gold partners are able to see the corresponding menu item and page content.
>
> See [Configuring permissions](https://docs.kentico.com/k8/managing-users/configuring-permissions.md) in the main documentation for more information.
