[SOLVED] Multiple External Member Login Providers ...
# help-with-umbraco
a
I've been trying to get a v12 site working with multiple Azure AD accounts (something that's been running fine for years on v7) but I've hit a wall. Works fine with one and I can trigger the SSO process for more than one but the postback from the provider always fails for any provider but the first one. I suspect this is something to do registering the schemes in a certain way but can't find any helpful documentation. I know this is possible I just seem to be missing something. Among other things, I've tried adding multiple
Copy code
builder.AddMemberExternalLogins()
and also multiple
Copy code
memberAuthenticationBuilder.AddOpenIdConnect
within that and they both throw
Copy code
Exception: Unable to unprotect the message.State
Any ideas?
d
Hi andyc, can you share the authentication schemes that you use when you register these login providers? I'm thinking that perhaps your registrations might overwrite eachother or parts of eachother.
a
Hiya. The only deviation from the boilerplate code that's in all the tutorials is the class name and the SchemeName variable.
d
I see, that's exactly how it should be, I think
Have you explicitly defined a return url for both the providers? If your return url for both providers is the same, that might explain why only one works, it would always be handled by the first handler you register
a
(heart sinks)
Great shout - I guess I've been super lazy!
Appreciate your time
d
Happy to help 😊
a
All working. You're my absolutely hero!
166 Views