ADFS 2.0 Master Page

Active Directory Federation Server (ADFS) runs on IIS web server. At first it appeared to be a bit mysterious how this was laid out but it is now obvious that it follows the rules of a typical Microsoft ASP.NET web site.

Inside the web files for ADFS lives the Master Page. For those not familiar with ASP.NET, the Master Page acts as a template for all pages based on it. It allows for a more consistent look and makes it easier to create new content. One change on the master page propagates immediately to all children pages.

This means that it might be possible to customize the look of ADFS without too much effort. Here is sampling of the ADFS Master Page. Click on the image to get a PDF listing.

The interesting bit about the master page is its support for logo files.  In the code above, it detects a configuration setting for ‘logo’ and potentially uses this as part of the ADFS pages.  This code is slightly tricky since it using old ASP tricks.  If I understand this correctly, it is conditionally injecting the logo image based on the configuration not having a null or empty string.

In practical use, you just need a setting in web.config to get this going.

appSettings comes directly under the configuration section.  Uncomment the ‘add key=”logo”‘ line and change the value to the URL of your desired header logo.

Not sure about this but you might need to restart the web server to make it take effect.

It is impressive that ADFS left the web pages and code in the open.  Potentially this could lead to all kinds of customization.

Microsoft has documented that this is possible.

Live near Brisbane, Australia. Software developer currently focused on iOS and Android. Avid Google Local Guide

Posted in ADFS, ASP.NET
One comment on “ADFS 2.0 Master Page
  1. laurentbel says:

    Hi,
    Excellent post. I recently wrote more or less a similar article. Maybe it will help anyone trying to customize ADFS login page. http://laurentbel.com/2011/12/12/customize-adfs-2-0-login-page-with-a-logo/

Comments are closed.

Archives
Categories
Follow Red Circle Blog on WordPress.com
%d bloggers like this: