Attempting to authenticate to on-prem SharePoint (2013 or 2016) doesn't seem to work if web application is configured to use multiple authentication types (Windows + SAML in our case).
I believe SPCB code should include ("X-FORMS_BASED_AUTH_ACCEPTED", "f") header as discussed here: https://msdn.microsoft.com/en-us/library/office/hh124553(v=office.14).aspx.
Comments: ** Comment from web user: BdeJager **
I believe SPCB code should include ("X-FORMS_BASED_AUTH_ACCEPTED", "f") header as discussed here: https://msdn.microsoft.com/en-us/library/office/hh124553(v=office.14).aspx.
Comments: ** Comment from web user: BdeJager **
Have not come across this scenario, but the link to MSDN seems to make sense.
Do you have the option to validate that solution? By downloading the sources and making updates to the authentication and validate it against your environment?