I have an ASP.NET application which dynamically creates an ICS calendar (using the DDay.iCal library) which I can subscribe to from within outlook. All is working fine, but I need to be able to secure the calendar so that only authenticated users can access it. i.e. when you add the URL to the calendar in outlook, it needs to ask for a username and password.
Remember The Milk seem to have implemented what I need, but I cannot seem to find any information on how to achieve this myself?
The article Chris provided as a comment was the solution.
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).
This is achieved by using the MADAM Http Module.
Steps:
1> Read the article to gain a basic understanding.
2> Install the MADAM NuGet package: PM> Install-Package madam
3> Implement your own IUserSecurityAuthority:
e.g
4> Add the following to your web config:
eg:
Note 1:
...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.
Note 2:
....is where you configure your custom authentication provider (i.e. where you check credentials against your DB).