How can I customize the default ADFS 2.0 login page with your company logo and maybe some CSS adjustment ?
Today I have finished the ADFS 2.0 configuration for our Microsoft Dynamics CRM 2011 implementation. I was of course very happy to get it working, but wanted afterwards to customize slightly this default login page starting with the usual logo :
I don’t think it is necessary to say that this default page is not “sexy”. But guess what Microsoft did it right : you can quite easily adjust it to your needs. Here is basic instructions to do it.
Step 1 : Login to your ADFS Server and open IIS and naviguate to C:\inetpub\adfs\ls
This location is the place where the ADFS “web site” is sitting.
Step 2 (can be skipped, it is just for understanding) : It is likely that you are familiar with a standard .NET web site structure. Let’s have a look in the MasterPages folder and the file named MasterPage.master. If you open the file and look line 17, you’ll find this piece of code :
string logoPath = System.Web.Configuration.WebConfigurationManager.AppSettings[ "logo" ];
if( !String.IsNullOrEmpty( logoPath ) )
<img src="<%= logoPath %>" alt="logo" />
This piece of code is quite explicite : A logo image is loaded, assuming you correctly specify it in your web.config !!! Let’s then have a look in the web.config.
Step 3 : Open the web.config file of the web site (root path)
Look now for the following lines :
<add key="logo" value="logo.png" />
Uncomment the lines and change the value so that it matches the file you are going to use as a logo. Here is what I did :
<add key="logo" value="logo-BE.png" />
Note : You might have to open Notepad (or whatever text editor you use) with “Run as administrator” in order to be able to save the file.
Step 4 : Drop your file (logo-BE.png in my example) at the root level of the web site.
Note that you might be prompted with security warnings because you are dropping files into a “system” folder of Windows.
Step 5 : Finished ! Just go back to your ADFS login page and press F5 to refresh the page (or CTRL + F5 to force a full refresh). Guess what, you’ll have a nice logo on your page…
At the end, it was not very complicated… I guess, if you are using an ADFS Farm (opposed to standalone installation) you’ll just have to replicate those changes on all servers… I’ll try to write another article later on about CSS customization for this ADFS login page.