I'm not that familiar with the SAML2 auth scheme. But pretty sure you need to give the sign-in cookie scheme a name and then specify that name in the SAML2 options sign-in scheme name.
I've tried a lot of different ways, but I now get a 500 error with the following message in the log:
The authentication handler registered for scheme 'Saml2' is 'Saml2Handler' which cannot be used for SignInAsync. The registered sign-in schemes are: Identity.Application, Identity.External, Identity.TwoFactorRememberMe, Identity.TwoFactorUserId, Cookies.
Not sure if it's correctly configured, but if it is, does it mean that Saml2 isn't supported in multiplex solution out of the box?
All schemes and setups are supported, it has nothing to do with the CMS. This is "just" asp.net core.
Can you get SAML2 to work on its own? I would start there.
I see, thank you for clarifying that.
Yes, SAML2 works on it's own, without using AspNetIdentity.
It's when "AddCmsAspNetIdentity" is used along with SAML2 when SAML2 stops working.
I solved it.
When using AspNetIdentity along with in my case SAML2 I needed to use IdentityConstants.ApplicationScheme as DefaultScheme instead of CookieAuthenticationDefaults.AuthenticationScheme.
Same goes for SignInScheme and SignOutScheme.
Thank you for your help Johan.
I am trying to configure our Optimizely CMS 12 to use multiplex login to the CMS.
I want to use both SAML2 using Sustainsys and AspNetIdentity authentication to access the CMS.
The configuration doesn't seem to do it, I can login with the CMS user but nothing is happening when I signin with SAML2.
I get redirected to the front page, without any access. The session cookie is set, but it seem that no access rights are given?
There is probably configuration missing, however I don't know what it is.
I've also tried the AddPolicy approach which didn't make any difference.
When I only choose to sign in with Saml2, it works. Same thing with AspNetIdentity. But they are not working when I try the multiplex appraoch.
This is the configuration: