Microsoft Outlook Web App 2010 – A Minimal FBA Logon Page.

Leave a comment
Share

People often ask about redesigning the Outlook Web App Forms-Based Authentication page, usually to give it a look that reflects their own corporate theme. There are a few Microsoft documents out there, but they only deal with superficials, and don’t really help those who want to, as it were, start from scratch.

Well, I spent some time whittling my own FBA page down to the bare essentials, and here are the results. Note that there is still a lot there (enough to make sure that there is still plenty of potential for┬áconfusion), but there is nothing that isn’t actually required.

The file is C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Owa\auth\logon.aspx What you do with it from here on is entirely up to you. And PLEASE – make a backup of the existing logon.aspx page before you start.

First, what it now looks like :-)

And here is the code:

<%@ Page language="c#" AutoEventWireup="false" Inherits="Microsoft.Exchange.Clients.Owa.Core.Logon" %>
<%@ Import namespace="Microsoft.Exchange.Clients"%>
<%@ Import namespace="Microsoft.Exchange.Clients.Owa.Core"%>
<%@ Import namespace="Microsoft.Exchange.Clients.Owa.Premium"%>

<% if (!ReplaceCurrent) { %>

<html>
<head>
<script type="text/javascript" src="<%=OwaUrl.ApplicationRoot.ImplicitUrl%>14.2.328.9/scripts/premium/flogon.js"></script>
<script type="text/javascript">
  var a_fRC = 0;
  var a_sUrl = "&url=<%=Utilities.JavascriptEncode(Utilities.UrlEncode(Destination)) %>";
  var a_sCW = "<%=Utilities.JavascriptEncode(CloseWindowUrl) %>";
  var a_sLgn = "<% RenderLogonHref(); %>";
</script>
</head>
<body>
<noscript>
  <%=Utilities.GetNoScriptHtml() %>
</noscript>
</body>
</html>

<% } else { %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; CHARSET=utf-8">
<meta name="Robots" content="NOINDEX, NOFOLLOW">
<title><%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.OutlookWebAccess) %></title>
<script type="text/javascript" src="<%=OwaUrl.ApplicationRoot.ImplicitUrl%>14.2.328.9/scripts/premium/flogon.js"></script>
<script type="text/javascript">
  var a_fRC = 1;
  var g_fFcs = 1;
  var a_fLOff = <%= (Reason == LogonReason.Logoff || Reason == LogonReason.ChangePasswordLogoff || Reason == LogonReason.Timeout) ? 1 : 0 %>;
  var a_fCAC = <%= ShouldClearAuthenticationCache ? 1 : 0 %>;
  var a_fEnbSMm = <%= SMimeEnabledPerServer ? 1 : 0 %>;
</script>
</head>

<body>
<noscript>
  <%=Utilities.GetNoScriptHtml() %>
</noscript>
<form action="/owa/auth.owa" method="POST" name="logonForm" ENCTYPE="application/x-www-form-urlencoded" autocomplete="off">
<input type="hidden" name="destination" value="<%=Utilities.HtmlEncode(Destination)%>">
<input type="hidden" name="flags" value="0">
<input type="hidden" name="forcedownlevel" value="0">

<div>
  <% if (Reason == LogonReason.Logoff)
    Response.Write(LocalizedStrings.GetHtmlEncoded(Strings.IDs.LogoffMessage));
  else if (Reason == LogonReason.Timeout)
    Response.Write(LocalizedStrings.GetHtmlEncoded(Strings.IDs.TimeoutMessage));
  else if (Reason == LogonReason.ChangePasswordLogoff)
    Response.Write(LocalizedStrings.GetHtmlEncoded(Strings.IDs.LogoffChangePasswordMessage));
%></div>

<div>
<%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.Security) %>
  <a href="#" id="lnkShwSec" onclick="clkExp('lnkShwSec')">
<%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.ShowExplanation) %> 
</a>
<a href="#" id="lnkHdSec" onclick="clkExp('lnkHdSec')" style="display:none">
  <%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.HideExplanation) %> 
</a>
</div>

<div>
<input id="rdoPblc" type="radio" name="trusted" value="0" onclick="clkSec()" checked>
<label for="rdoPblc"><%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.ThisIsAPublicOrSharedComputer) %></label><br>
<div id="trPubExp" style="display:none">
  <%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.PublicExplanation) %>
</div>
<input id="rdoPrvt" type="radio" name="trusted" value="4" onclick="clkSec()">
<label for="rdoPrvt"><%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.ThisIsAPrivateComputer) %></label><br>
<div id="trPrvtExp" style="display:none">
  <%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.PrivateExplanation) %>
</div>
<div id="trPrvtWrn" style="display:none">
  <%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.PrivateWarning) %>
</div>
</div>

<% if (ShowOwaLightOption)
{
  string basicExplanationLink = string.Format("<a href=\"{1}\" id=\"bscLnk\">{0}</a>", LocalizedStrings.GetHtmlEncoded(Strings.IDs.BasicExplanationLink), Globals.SupportedBrowserHelpUrl);
  string basicExplanationContent = string.Format(LocalizedStrings.GetHtmlEncoded(Strings.IDs.BasicExplanation), basicExplanationLink);
  %><input id="chkBsc" type="checkbox" onclick="clkBsc();">
  <label for="chkBsc"><% = LocalizedStrings.GetHtmlEncoded(Strings.IDs.UseOutlookWebAccessBasicClient) %></label><br>
  <div id="trBscExp" style="display:none">
  <% = basicExplanationContent %>
  </div>
<% } %>

<label for="username"><% = UserNameLabel %></label>
<input type="text" name="username"><br>
<label for="password"><% = LocalizedStrings.GetHtmlEncoded(Strings.IDs.PasswordColon) %></label>
<input type="password" name="password">
<input type="submit" value="<% = LocalizedStrings.GetHtmlEncoded(Strings.IDs.LogOn) %>" onclick="clkLgn()">
<input name="isUtf8" type="hidden" value="1">

<% if (Reason == LogonReason.InvalidCredentials)
{
  %><div><%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.InvalidCredentialsMessage) %></div>
<% } %>

<div id="tblMid2" style="display:none">
  <% = LocalizedStrings.GetHtmlEncoded(Strings.IDs.CookiesDisabledMessage) %><br>
  <input type="button" value="<%=LocalizedStrings.GetHtmlEncoded(Strings.IDs.Retry) %>" onclick="clkRtry()">
</div>

</form>
</body>
</html>

<% } %>




Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>