Skip to content

Instantly share code, notes, and snippets.

@gsherman
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsherman/a90bc2c399d7f54c0aaa to your computer and use it in GitHub Desktop.
Save gsherman/a90bc2c399d7f54c0aaa to your computer and use it in GitHub Desktop.
Custom 404.1 Unauthorized page for Dovetail Agent 5

How to setup a custom 401.1 (Unauthorized) page for use with Dovetail Agent 5

This is useful when the Agent app is setup to use Windows authentication

Screenshot of the 401 page

Screenshot of the 401 page:

Configuration for a custom error page

Edit the $dovetailAgent\app\web.config file

Within the system.webserver node, add a httpErrors node, like so:

<system.webServer>
  ...
        <httpErrors errorMode="Custom"> <!-- DetailedLocalOnly, Custom, Detailed -->
            <error statusCode="401" subStatusCode="1" path="401-1.html" responseMode="File" />
        </httpErrors>
  </system.webServer>

Notice that the errorMode is set to Custom. More details on the httpErrors node

Note: This can also be done using IIS.

* Open the Internet Information Services Manager
* In the left pane, click the Dovetail Agent web application
* From the Features view click on Error Pages
* Click on Add
	* Status code: 401.1
	* Insert content from statisc file: 401-1.html
* Click on Edit Feature Settings
* Click on Custom Error pages (or Detailed for local and custom for remote)
* Click OK

Copy the 401-1.html page (from this gist) to the root of the Agent application

Enable anonymous access to the content directory

* Open the Internet Information Services Manager
* In the left pane, click and expand on the Dovetail Agent web application
* Under the Agent web application, click on the **content** folder
* Double-click on the **Authentication** feature icon (within the IIS category)
* Click on **Anonymous Authentication** from the list
* Click **Enable** in the right sidebar
* Click on **Windows Authentication** from the list
* Click **Disable** in the right sidebar
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>401.1 - Unauthorized: Access is denied due to invalid credentials.</title>
<meta name="description" content=""/>
<meta name="author" content="Dovetail Software"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/_content/styles/bootstrap.css">
<link rel="stylesheet" href="/_content/styles/styles.css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<div class="navbar navbar-fixed-top" id="global-nav">
<div class="navbar-inner">
<div class="row-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
</div>
</div>
<div id="notifications"></div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="container-fluid">
<div class="row-fluid">
<div class="span6 offset3">
<a href="/"><div class="signin logo"></div></a>
<div >
<h2>Unauthorized</h2>
<h3>Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials that you supplied.</h3>
<h4>Error code 401.1</h4>
<hr/>
<p>Contact your Dovetail administrator for assistance.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<p class="pull-left">Brought to you by Dovetail Software</p>
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment