Consider the situation, you have a SharePoint site, protected by Forms Based Auth, and you also need to write code that will use the SharePoint API (say a windows service that needs to work with SharePoint).
This is a much too common scenario, and here is how you should implement this.
- I assume that the SharePoint site is in a domain.
- Create a domain user, say domain\smalik.
- Run the service as the domain\smalik user.
- Now, via the farm's central admin, extend the web app to another port - this time protected by Windows Auth.
- From the windows auth site, add domain\smalik to the site with full control (or whatever restricted control, should your code be happy with it).
- Go back to central admin, and delete the extended website.
- Ensure that the AAMs & host headers are setup appropriately, or you'll get "No web application at URL ...." error.
- Thats it! Now your Load balanced, FBA site will be accessible via SharePoint API, as long as your code runs as domain\smalik.