I have added multiple same2 configuration and its working fine for the first one but not working with second configuration.
I have multiple Saml configuration with different schema as below.
.AddSaml2("SCHM-MI", options =>
{
options.SPOptions.EntityId = new EntityId("SCHM-MI");
options.IdentityProviders.Add(new IdentityProvider(
new EntityId(".............."), options.SPOptions)
{
MetadataLocation = "...................",
LoadMetadata = true
});
})
.AddSaml2("SCHM-GL",options =>
{
options.SPOptions.EntityId = new EntityId("SCHM-GL");
options.IdentityProviders.Add(new IdentityProvider(
new EntityId(".................."), options.SPOptions)
{
MetadataLocation = "............",
LoadMetadata = true
});
});
This is my challenge request on login.
return new ChallengeResult(
"SCHM-GL",
new AuthenticationProperties
{
RedirectUri = Url.Action(nameof(LoginCallback), new { returnUrl = "http://localhost:4200/callback" }),
});
This configuration is working fine for "SCHM-MI" but not working for "SCHM-GL". I am getting below error on request.
KeyNotFoundException: No Idp with entity id "GL Entity ID" found.
Sustainsys.Saml2.Configuration.IdentityProviderDictionary.get_Item(EntityId entityId)
I am using the latest version of Sustainsys.Saml2.AspNetCore2.
Thanks
Imrankhan Pathan