IdentityServer / IdentityServer4

OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
https://identityserver.io
Apache License 2.0
9.23k stars 4.01k forks source link

Not able to configure Azure B2C tenant as external identity provider in Identity server 4 #5404

Closed nishantjadhaviss closed 2 years ago

nishantjadhaviss commented 2 years ago

Hi Team,

We are trying to configure Azure B2C tenant as external identity provider in identity server 4 developed using dotnet core 2.1. We added below code to the start up file. Also added button on login page and enabled external login from account controller.

.AddOpenIdConnect("AzureB2C", "Azure AD B2C", options => { options.ClientId = "appId registered at Azure B2C app registration"; options.Authority = "https://b2ctenantname.b2clogin.com/tfp/directoryname/signinpolicy"; options.ClientSecret = "client secrete"; options.ResponseType = "id_token"; options.CallbackPath = "/signin-aad"; options.SignedOutCallbackPath = "/signout-callback-aad"; options.RemoteSignOutPath = "/signout-aad"; options.TokenValidationParameters = new TokenValidationParameters { NameClaimType = "name", RoleClaimType = "role" }; });

We also tried different patterns of the authority url for B2C tenant like belows. https://b2ctenantname.b2clogin.com/tfp/directoryname/signinpolicy https://b2clogin.com/tfp/tenantid/policy https://b2clogin.com/tenantid/signinpolicy https://login.microsoftonline.com/tfp/tenantId/signinpolicy/v2.0 https://login.microsoft.com/tfp/tenantId/signinpolicy/v2.0

Its not redirecting to the login page for the B2C. Please share the how we can use B2C as external identity provider.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

nishantjadhaviss commented 2 years ago

We can close this issue. Successfully configured Azure B2C directory user flows using below authority url https://b2cdirectoryname.b2clogin.com/b2cdirectoryname.onmicrosoft.com/userpolicyname/v2.0

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.