New answers tagged claims-based-auth
You may configure Form Based Authentication (see in the Authentication Providers page for the Web app in CA), and then edit the web.config file (on each WFE) to change the loginUrl property of the <forms> tag to point to your own page.
As far as I read your requirements then it's out of the box functionality, so no need to write any code. Configure SharePoint to accept logins from the two other domains' ADFS servers (see TechNet: Configure SAML-based claims authentication with AD FS in SharePoint 2013) and it should just work: When users access SharePoint they'll be asked to select ...
Top 50 recent answers are included