Closed piermorosini closed 6 years ago
I don't comprehend your full example, but the key when using OWIN middleware and multiple instances is that each one needs to have a separate SPOptions.ModulePath
value. There is an example here: https://github.com/KentorIT/authservices/blob/master/doc/IdentityServer3Okta.md
Sorry, I looked to that page but I wasn't able to understand what is Module path. It's a folder path? If yes what is folder content?
Many thanks for help Pierluigi
It's just a virtual path that lets the middleware separate the requests coming back from the IDPs. You do not need any content at that path.
The line I was referring to in the example code was this one:
ModulePath = string.Format("/{0}", idpName) // this is important -- it is what drives the separate instances
Ok I try Thanks for help Have a good day
Old issue without recent activity, closing.
Hi adding 2nd provider in this way
//***1st provider works fine var spOptionsAuth0 = new SPOptions { EntityId = new EntityId("urn:xxxxxxxxxxxxxxxxxxxxxxxxx1"), ReturnUrl = new Uri("xxxxxxxxxxxxxxxxxxx1/Account/ExternalLoginCallback"), }; spOptionsAuth0.ServiceCertificates.Add(new X509Certificate2( AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "/Certificates/Kentor.AuthServices.Tests.pfx", "", X509KeyStorageFlags.MachineKeySet)); var authServicesOptionsAuth0 = new KentorAuthServicesAuthenticationOptions(false) { SPOptions = spOptionsAuth0 }; var idpAuth0 = new IdentityProvider(new EntityId("urn:xxxxxxxxxxxxxxxxxxxxxxx1"), spOptionsAuth0) { AllowUnsolicitedAuthnResponse = true, Binding = Saml2BindingType.HttpRedirect, SingleSignOnServiceUrl = new Uri("xxxxxxxxxxxx1/samlp/FAycoSlqtr5Uc66Euv3o1cDITt22dQ2B") }; idpAuth0.SigningKeys.AddConfiguredKey( new X509Certificate2( HostingEnvironment.MapPath( "~/Certificates/xxxxxxxxxxxx.1cer")));
//***2nd provider var spOptionsAuth0 = new SPOptions { EntityId = new EntityId("urn:xxxxxxxxxxxxxxxxxxxxxxxxx2"), ReturnUrl = new Uri("xxxxxxxxxxxxxxxxxxx2/Account/ExternalLoginCallback"), }; spOptionsAuth0.ServiceCertificates.Add(new X509Certificate2( AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "/Certificates/Kentor.AuthServices.Tests.pfx", "", X509KeyStorageFlags.MachineKeySet)); var authServicesOptionsAuth0 = new KentorAuthServicesAuthenticationOptions(false) { SPOptions = spOptionsAuth0 }; var idpAuth0 = new IdentityProvider(new EntityId("urn:xxxxxxxxxxxxxxx2"), spOptionsAuth0) { AllowUnsolicitedAuthnResponse = true, Binding = Saml2BindingType.HttpRedirect, SingleSignOnServiceUrl = new Uri("xxxxxxxxxxxx2/samlp/FAycoSlqtr5Uc66Euv3o1cDITt22dQ2B") }; idpAuth0.SigningKeys.AddConfiguredKey( new X509Certificate2( HostingEnvironment.MapPath( "~/Certificates/xxxxxxxxxxxx2.cer")));
in @foreach (AuthenticationDescription p in loginProviders) {
Both certificates have the same link
Thanks for help Pierluigi