Open euhm opened 11 months ago
cc @damienbod @CamSoper
Hi @euhm
The code snippet is part of the setup used in the configure services block, depending on how you do this. Have you set this up like in the docs (step 5)?
Kind regards Damien
Hello,
apologies for the late reply.
I indeed set it up as in step 5. But I assume the sample code 'conflicts' with other authentication configurations. ADB2C setup is done in a codebase from a CMS. The cms also configures authentication.
services.AddAuthentication(options => { options.DefaultAuthenticateScheme = IdentityConstants.ApplicationScheme; options.DefaultChallengeScheme = IdentityConstants.ApplicationScheme; options.DefaultSignInScheme = IdentityConstants.ExternalScheme; })
where IdentityConstants.ApplicationScheme = Identity.Application (AspNetCore Identity as well)
I resolved the issue using a policy scheme to use the correct scheme during runtime. I don't know if it can help to mention something in the docs, or if its overkill.
Thanks,
bob
Hello,
in the sample azure-ad-b2c/sample/Program.cs you have the following code which didn't work in my scenario.
.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
needed to be replaced with
.AddAuthentication(options => { options.DefaultAuthenticateScheme = OpenIdConnectDefaults.AuthenticationScheme; options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; }
Is the snippet incomplete or did I miss something on my end?
Kind regards,
bob
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.