I'm trying to implement Azure Active Directory B2C in a new page I'm developing, but I'm getting this 404 - File or directory not found
error trying to sign in from my page.
I made the tenant, registered my app, created my policies, the whole deal. I can test them from the Azure portal without much problem. However, I followed the directions over the official tutorial to implement the policies in my page to no avail, I'm getting the mentioned 404 error as if something's missing.
I even downloaded the code posted there and it works!
I tried comparing both codes but couldn't really see a difference. However, I'm pasting my code here hoping you could help me out with this.
WEB.CONFIG
<add key="ida:Tenant" value="PlataformaXXX.onmicrosoft.com" />
<add key="ida:ClientId" value="84d2a6e6-4cac-4c53-a5ff-XXXXXXXXXXXX" />
<add key="ida:AadInstance" value="https://login.microsoftonline.com/{0}/v2.0/.well-known/openid-configuration?p={1}" />
<add key="ida:RedirectUri" value="https://localhost:59744/" />
<add key="ida:SignUpPolicyId" value="B2C_1_Sign_Up" />
<add key="ida:SignInPolicyId" value="B2C_1_Sign_In" />
<add key="ida:UserProfilePolicyId" value="B2C_1_Edit" />
STARTUP.AUTH.CS
public partial class Startup
{
// App config settings
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
private static string aadInstance = ConfigurationManager.AppSettings["ida:AadInstance"];
private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
private static string redirectUri = ConfigurationManager.AppSettings["ida:RedirectUri"];
// B2C policy identifiers
public static string SignUpPolicyId = ConfigurationManager.AppSettings["ida:SignUpPolicyId"];
public static string SignInPolicyId = ConfigurationManager.AppSettings["ida:SignInPolicyId"];
public static string ProfilePolicyId = ConfigurationManager.AppSettings["ida:UserProfilePolicyId"];
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
// Configure OpenID Connect middleware for each policy
app.UseOpenIdConnectAuthentication(CreateOptionsFromPolicy(SignUpPolicyId));
app.UseOpenIdConnectAuthentication(CreateOptionsFromPolicy(ProfilePolicyId));
app.UseOpenIdConnectAuthentication(CreateOptionsFromPolicy(SignInPolicyId));
} ...
If any other chunk of code is needed, please tell me.
Really guys, any help will be very much appreciated.
Best regards, Toño.