elerch / SAML2

Fork of SAML2 library on codeplex. This library removes dependencies on Asp.net
Mozilla Public License 2.0
117 stars 62 forks source link

Mapping for multiple IdPs #22

Open sonjabijou opened 6 years ago

sonjabijou commented 6 years ago

Hi! I have a scenario where I have multiple IdPs, and I've put their metadata files in a single folder which I add using saml2Config.IdentityProviders.AddByMetadataDirectory. Is it possible to map attributes of a request (e.g. host name) to the appropriate IdP? If so, what's the recommended method?

sonjabijou commented 6 years ago

I found the IdpSelectionUtil.IdpSelectionEvent, which I'm handling with logic to map HttpContext.Current.Request against the IdPs. This is working well. If there's a better method though, please let me know. :)