---
title: "Create Custom Login Methods"
canonical: "https://help.agiloft.com/space/HELP/925466673/Create+Custom+Login+Methods"
format: markdown
---
If you're comfortable with HTML and CSS, you can customize how users log in to your system. For instance, you can add custom login blocks or password reset blocks to webpages, as well as use predefined templates to create custom login pages and password reset pages. You can add your own logo, change text, and adjust various style options to match a desired look and feel.

> ℹ️ **Prerequisites**
> ℹ️ 
> ℹ️ If you want to make changes to your knowledgebase login page or password reset page, we recommend you have the following:
> ℹ️ 
> ℹ️ - Basic knowledge of HTML
> ℹ️ - Basic knowledge of CSS
> ℹ️ 
> ℹ️ You can learn more about these topics at [W3 Schools](https://www.w3schools.com/).

## Create Custom Login and Password Reset Pages

If your knowledgebase is hosted on Agiloft's servers, you can use the following instructions to create a custom login page and a custom password reset page.

#### Update the Login Page Template

![image](media://feef5143-f7c4-4429-b516-8be544fd5f9e)

To help you create custom login pages more easily, you can download a sample HTML page.

1. Download the  file.
2. Open the file with a simple text editor or a free source code editor, such as Notepad++.
3. Update the following items in the login page template:
  1. Update the `title` element with the title you want to appear in the browser's tab.  
> Macro (inline-media-image)
  2. Update the `img` element with a new image file:
    1. If the file is web-based, update the `src` attribute with a link to the image of your desired logo. Add `alt` and `style` attributes, specifying appropriate alt text and the image's width and height in pixels.  
> Macro (inline-media-image)
    2. If the file is local, simply include the filename, such as `"xyz-logo.png"` or similar, including the quotation marks. You will provide the file to the Agiloft Support team to upload in a later step.  
> Macro (inline-media-image)
  3. Update the `h1` element with your company's name.  
> Macro (inline-media-image)
  4. Update the `action` attribute of the `form` element with the current login URL for your KB.  
> Macro (inline-media-image)
  5. Update the `value` attribute of the first `input` element with your KB project name. If you don't know this, ask your assigned implementer or project manager.  
> Macro (inline-media-image)
  6. Update the `value` attribute of the second `input` element by creating an updated KB login URL, using this form: `https://yourKB-dns.agiloft.com/logins/folder/login-page-template.html`. For example, if your original KB login URL is `https://xyz.agiloft.com//gui2/login.jsp`, your template file will be saved in a folder on your server called `template`, and your template file is named `xyz-login.html`, the `value` attribute will look like this: `value="https://xyz.agiloft.com/logins/template/xyz-login.htm"`.  
> Macro (inline-media-image)
  7. Update the `href` attribute of the last `a` element with the filename of your password reset page template. Remember this filename so that you use the same name when you update the password reset page template in the next section.  
> Macro (inline-media-image)
4. If desired, update the optional color and style properties in the login page template:
  1. Adjust the style of the "Forgot your password?" link:
    1. Update the `color` property in the `a:active` selector with a new color for the link.
    2. Update the `text-decoration` property in the `a:hover` selector with the hover behavior for the link.  
> Macro (inline-media-image)
  2. Update the `background-color` property in the `body` selector with a new background color.  
> Macro (inline-media-image)
  3. Update the `color` property in the `h1` selector with a new color for the title.  
> Macro (inline-media-image)
  4. Update the `color` property in the `td` selector with a new color for the "Username:" and "Password:" text.  
> Macro (inline-media-image)
5. Save the template file and leave it open. This allows you to easily copy color codes and other data to the password reset page template.

#### Update the Password Reset Page Template

![image](media://f4eb4a92-be76-4bde-ab0d-4ef9fe266682)

Next, update a similar file to help you create a custom password reset page. For all color choices, we recommend using the same colors from the login page template.

1. Download the  file.
2. Open the file with a simple text editor or a free source code editor, such as Notepad++.
3. Update the following items in the password reset page template:
  1. Update the `title` element with the title you want to appear in the browser's tab.  
> Macro (inline-media-image)
  2. Update the `img` element with a new image file:
    1. If the file is web-based, update the `src` attribute with a link to the image of your desired logo. Add `alt` and `style` attributes, specifying appropriate alt text and the image's width and height in pixels.  
> Macro (inline-media-image)
    2. If the file is local, simply include the filename, such as `"xyz-logo.png"` or similar, including the quotation marks. You will provide the file to the Agiloft Support team to upload in a later step.  
> Macro (inline-media-image)
  3. Update the `h1` element with your company's name.  
> Macro (inline-media-image)
  4. Update the `action` attribute of the `form` element with the current password reset URL for your KB.  
> Macro (inline-media-image)
  5. Update the `value` attribute of the third `input` element with your KB project name. If you don't know this, ask your assigned implementer or project manager.  
> Macro (inline-media-image)
4. If desired, update the optional color and style properties in the password reset page template:
  1. Update the `background-color` property in the `body` selector with a new background color.  
> Macro (inline-media-image)
  2. Update the `color` property in the `div.container` selector with a new color for the "Login or Email address" text and the instructional text.  
> Macro (inline-media-image)
  3. Update the `color` property in the `h1` selector with a new color for the title.  
> Macro (inline-media-image)
  4. Update the `p` element with new instructional text for the password reset process.  
> Macro (inline-media-image)
5. Save the file with the same name you specified in the template for the custom login page.

#### Finish the Process

To complete the process, send the templates to Agiloft, test the new pages, and edit the appropriate global variables in your KB.

1. Create a support ticket, attach the template files you updated and your optional company logo, and request that they be uploaded to your KB's server. Make sure the template and logo filenames match the filenames you used within the templates themselves.
2. Wait for the Agiloft Support team to verify with you that the files have been uploaded.
3. Once verified, test that both the KB login page and the password reset page work.
4. After confirming that the pages work, log in to the KB as an admin user and go to **Setup > System > Manage Global Variables**.
5. Change the Login URL and Exit URL global variables to the updated KB login URL.

## Add a Custom Login Block to a Webpage

Custom login blocks can be added to any webpage using standard HTML:

```xml
<form method= "post" 
 action="http://www.example.com/gui2/login.jsp" > 
 <input type= "hidden" name= "KeyID" 
 value="0" > 
 <input type= "hidden" name= "state" 
 value= "Main" > 
 <input type= "hidden" name= "project" 
 value= "KnowledgeBaseName" > 
 <input type= "hidden" name="exiturl" 
 value="http://www.example.com" > 
 <input type= "hidden" name= "loginurl" 
 value="http://www.example.com" > 
 <table border= "0" width= "90%" > 
 <tr><td align=left>Username:</td> 
 <td> </td> 
 <td> 
 <input type="text" size= "30" 
 maxlength= "50" 
 name= "user" 
 value= "admin"> 
 </td> 
 </tr> 
 <tr><td align=left>Password:</td> 
 <td> </td> 
 <td> 
 <input type="password" size= "30" 
 maxlength= "50" 
 name= "passwd" > 
 </td> 
 </tr> 
 <tr> 
 <td align=left> </td> 
 <td> </td> 
 <td> 
 <input type= "submit" 
 value= "Login" > 
 </td> 
 </tr> 
 </table> 
 </form>
```

This will result in: 

![image](media://db63ff10-b2d9-4ad2-973e-1e6dad658a1e)

#### Using a Bash Script to Generate a Login Page

The bash script file linked below will allow you to generate such a login page. Simply download the script to the Linux server and run it:

 

```
sudo bash make_html.sh
```

## Add a Custom Password Reset Block to a Webpage

Custom password reset blocks can also be added to any webpage using standard HTML:

```xml
 <form action="http://[serverhostname]/gui2/resetPassword" 
 method=post> 
 Login:<input type=text name=login size=25 maxlength=50><br> 
 or email address:<input type=text name=email size=25 
 maxlength=50><br> 
<input type="hidden" name="resettype" value="email" />
<input type="hidden" name="resettype" value="text message" />
<input type="hidden" name="mode" value="request" />
<input type=hidden name=project value=[KB Name]> 
<input type=submit value=Go> 
<form>
```

#### Related articles

> Macro (contentbylabel)