Sustainsys Saml2 return 404 when call back from iDP on route Saml2/Acs

221 Views Asked by At

I have the following property:

IDP: Azure AD

Service Provider: .Net 6 ( with IdentityServer4)

I was able to read Identity providers from the database instead of adding in the startup.cs like .AddSaml2("Saml2").

When I add .AddSaml2() then proper redirect is happening to our external callback endpoint after user authentication.

When I don't add .AddSaml2() in startup.cs then I see 'https://localhost:74329/Saml2/Acs' is not found (404).

Am I missing anything?

Any help would be much appreciated!

1

There are 1 best solutions below

0
Anders Abel On BEST ANSWER

Adding the identity providers is just one of the things that .AddSaml2() does. Another is to register the handler that responds to /Saml2/Acs. Even if you load your identity providers from the DB, you need the call to AddSaml2().