From the MVC application, I am preparing an iCal authentication subscription after answering this SO question:
Serving an iCalendar file in ASPNET MVC with authentication
The iCal stream is dynamically created from events in the database using the DDay.iCal library.
This solution works fine on the local development server: both OSX Calendar and Outlook can subscribe and receive updates from the application.
However, on the shared server of my web host, authentication does not work for both Calendar and Outlook. That is, they both ask me about the user and password after unsuccessful (correct) ones.
EDIT: If I point the browser to the calendar URL, it will also complete authentication.
EDIT: Retrieve authentication in Weirder-Firefox and retrieve the iCal file. Check Safari, Chrome and IE.
If I point the cursor to the calendar URL with the same credentials, I succeed (that is, I get the desired iCal file). And, of course, the same credentials can be used to enter the MVC application.
EDIT - I think I know what is happening, but I donβt know how to fix it. In my OnAuthorization() I only add WWW-Authentication Basic , but with Fiddler I can see that there are three types of authentication offered:
HTTP/1.1 401 Unauthorized WWW-Authenticate: Basic realm="Secure Calendar" WWW-Authenticate: Negotiate WWW-Authenticate: NTLM ... etc ...
At the moment, only Firefox is responding with basic authorization, which succeeds.
GET <<URL>> HTTP/1.1 ... Authorization: Basic <<encoded credentials>>
IE responds with Negotiate, which doesn't work
GET <<URL>> HTTP/1.1 ... Authorization Negotiate <<encoded stuff>>
Who adds the other two and how can I make him stop? Here in more detail from the server response:
HTTP/1.1 401 Unauthorized Cache-Control: private Transfer-Encoding: chunked Content-Type: text/html Server: Microsoft-IIS/7.5 X-AspNetMvc-Version: 3.0 WWW-Authenticate: Basic realm="Secure Calendar" X-AspNet-Version: 4.0.30319 WWW-Authenticate: Negotiate WWW-Authenticate: NTLM X-Powered-By: ASP.NET X-Powered-By-Plesk: PleskWin Date: Tue, 23 Oct 2012 13:27:48 GMT
Thanks Eric