I have a SharePoint 2013 web application configured for both Windows Authentication and FBA (which is working fine).
I also have some code which executes a CSOM request using windows credentials, this is also working fine.
The problem is when I introduce a custom sign-in page. When I do this the form works fine (allows FBA users to login to SharePoint) but all of my CSOM API calls fail with:
"Cannot contact site at the specified URL"
If I look in Fiddler when my CSOM request is executed I can see that the calls are:
Default Sign In Page
- 401 /_vti_bin/sites.asmx
- 200 /_vti_bin/sites.asmx
- 200 /_vti_bin/client.svc/ProcessQuery (contains correct JSON response)
Custom Sign In Page
- 302 /_vti_bin/sites.asmx
- 401 /_layouts/15/TestLogin/Login.aspx (my custom login form)
- 302 /_layouts/15/TestLogin/Login.aspx (redirect them to the Win Auth login)
- 302 /_windows/default.aspx (the OOB "windows login" form)
- 200 /_vti_bin/sites.asmx
- "ProcessQuery" is never hit
Note - for clarity this is not using Apps. This is a CSOM call from a Console Application!