Search code examples
c#.nethttpclientlotus-domino

.NET - Consuming HTTP services on (Domino) server with form based authentication


I am writing a utility in C# (.NET) which will use HTTP to request data from a Domino web server.

However, this server uses form based authentication, not basic HTTP authentication.

I am trying to find out how to code to do HTTP GETS/POSTS with a server that has form based authentication.

I have tried every google query I can think of, but as soon as the words "form based authentication" are in the query, all of the results only pertain to implementing the service server-side, usually in ASP.NET or Sharepoint, with no results about consuming such services from the client side.

I saw the Java code from a related question suggested here in Stack Overflow, but finding the relevant parts in foreign APIs in the other language is going to be an adventure. If there is .NET sample code or documentation available, I would really appreciate it.


Solution

  • I am sure someone can provide a better answer but thinking about this I would assume your server that hosts the web service has some sort of login mechanism to establish that you're authenticated. So my approach would be to first post into the login page, accept the forms authentication cookie, then continue with whatever following requests you want to make. All following requests will already have the forms authentication cookie in them.