Closed dmhiggins23 closed 1 year ago
@dmhiggins23 : b2c is supported in OWIN web APIs, but not yet in web apps. It's on the backlog, but not super high priority.
Did you consider Microsoft Entra External IDs. Assuming you are building a new app?
Thanks Jean-Marc, unfortunately I am locked into an Orchard CMS 1.10 project. I have a large code base written against that platform with a couple of existing production sites.
Microsoft.Identity.Web Library
Microsoft.Identity.Web.OWIN
Microsoft.Identity.Web version
2.12.4
Web app
Sign-in users
Web API
Not Applicable
Token cache serialization
In-memory caches
Description
I've been working towards using Microsoft.Identity.Web to use AD B2C for authentication in an OWIN project. It does not appear to be adding the SignUpSignInPolicyId to the url during the initial back channel query to the server.
Reproduction steps
I've recreated a minimal version of the project at https://github.com/AzureAD/microsoft-identity-web/tree/master/tests/DevApps/aspnet-mvc/OwinWebApp
This is the startup code:
I'm using a appsettings.json config file to store the configuration information.
If I configure it as an active directory application (i.e., not B2C), it works fine. When I hit the protected action I get the login prompt and can log in.
When I configure the appsettings.json as a AD B2C app, I get the following exception
If I pull the url from this exception, namely
https://<DOMAIN_NAME>.b2clogin.com/<DOMAIN_NAME>.onmicrosoft.com/v2.0/.well-known/openid-configuration
and append the sign in policy id to it as followshttps://<DOMAIN_NAME>.b2clogin.com/<DOMAIN_NAME>.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_SignUp_SignIn
, and visit that url in a browser, the browser retrieves the same document as I get when go to the "Run User Flow" section of the azure portal for that directory.I've added the following code to startup after the call to factory.build
This produces the following output, reflecting at least a part of the the loaded configuration (i.e. MicrosoftIdentityApplicationOptions).
The appsettings.json file contains:
For the sake of completeness, here is packages.config:
Is there a working version of Microsoft.Identity.Web.Owin being used to access a B2C directory?
I cannot determine if this is an error in my code, a bug in Microsoft.Identity.Web.Owin, or a known limitation of Microsoft.Identity.Web. Any guidance would be greatly appreciated.
Error message
No response
Id Web logs
No response
Relevant code snippets
Regression
No response
Expected behavior
retrieve open id connect data from server