Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://msdn.microsoft.com/en-us/library/aa479391.aspx" rel="noreferrer">The article Chris provided as a comment</a> was the solution. </p> <p>What's required is to by-pass Forms Authentication for certain requests and use Basic HTTP Authentication instead. This is then supported by Outlook (and potentially other agents, like web browsers).</p> <p>This is achieved by using the <a href="http://www.raboof.com/projects/madam/" rel="noreferrer">MADAM Http Module</a>.</p> <p>Steps:</p> <p>1> Read the article to gain a basic understanding.</p> <p>2> Install the MADAM NuGet package: <strong>PM> Install-Package madam</strong></p> <p>3> Implement your own <strong>IUserSecurityAuthority</strong>:</p> <p>e.g</p> <pre><code>public class MadamUserSecurityAuthority : IUserSecurityAuthority { public MadamUserSecurityAuthority() { } //This constructor is required public MadamUserSecurityAuthority(IDictionary options) { } public object Authenticate(string userName, object password, PasswordFormat format, IDictionary options, string authenticationType) { if (_yourAuthenticationService.isValid(userName, password.ToString())) return true; //Returning null means the authentication failed return null; } public string RealmName { get { return "MADAM"; } } } </code></pre> <p>4> Add the following to your web config:</p> <p>eg:</p> <pre><code>&lt;sectionGroup name="madam"&gt; &lt;section name="userSecurityAuthority" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt; &lt;section name="formsAuthenticationDisposition" type="Madam.FormsAuthenticationDispositionSectionHandler, Madam"/&gt; &lt;/sectionGroup&gt; &lt;madam&gt; &lt;formsAuthenticationDisposition&gt; &lt;discriminators all="true"&gt; &lt;discriminator inputExpression="Request.Url" pattern="Calendar\.aspx" type="Madam.RegexDiscriminator"/&gt; &lt;/discriminators&gt; &lt;/formsAuthenticationDisposition&gt; &lt;userSecurityAuthority realm="MADAM" provider="YourAppAssembly.MadamUserSecurityAuthority, YourAppAssembly"/&gt; &lt;/madam&gt; &lt;httpModules&gt; &lt;add name="FormsAuthenticationDisposition" type="Madam.FormsAuthenticationDispositionModule, Madam"/&gt; &lt;add name="AuthenticationModule" type="Madam.BasicAuthenticationModule, Madam"/&gt; &lt;/httpModules&gt; </code></pre> <p><strong>Note 1:</strong> </p> <pre><code>&lt;discriminator inputExpression="Request.Url" pattern="Calendar\.aspx" type="Madam.RegexDiscriminator"/&gt; </code></pre> <p>...is used to identify which requests should by-pass forms authentication and use basic HTTP authentication, this is done with Regex, and you can add multiple discriminators.</p> <p><strong>Note 2:</strong></p> <pre><code>&lt;userSecurityAuthority realm="MADAM" provider="YourAppAssembly.MadamUserSecurityAuthority, YourAppAssembly"/&gt; </code></pre> <p>....is where you configure your custom authentication provider (i.e. where you check credentials against your DB).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload