active-directory-aspnetcore-webapp-openidconnect-v2
active-directory-aspnetcore-webapp-openidconnect-v2 copied to clipboard
System.string is hidden in Azure AD B2C or PII issue
This page comes after I click signup/signin button
Important links
https://aka.ms/IdentityModel/PII
Configure authentication in a sample web application by using Azure Active Directory B2C | Microsoft Docs
Please help me with the solution
@AdityaGupta1409 did you enable the PII ?
What is the Instance and the tenant Id that you use in the appsettings.json?
@jmprieur I don't know how to enable PII If you can let me know that would be great.
and my appsettings.json (removed client id for security) { "AzureAdB2C": { "Instance": "https://www.beaconcreate.net/", "ClientId": "", "Domain": "beaconcreate.onmicrosoft.com", "SignedOutCallbackPath": "/signout/B2C_1_beaconcreate", "SignUpSignInPolicyId": "B2C_1_beaconcreate", "ResetPasswordPolicyId": "B2C_1_password_reset", "EditProfilePolicyId": "B2C_1_profile_edit" // Optional profile editing policy //"CallbackPath": "/signin/B2C_1_sign_up_in" // defaults to /signin-oidc }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*" }
or if you can mail me [email protected] I'll send you full code
I'm having the same problem with a new solution
As soon as I add SignUpSignInPolicyId to the config I get the error. Run without SignUpSignInPolicyId .
@AdityaGupta1409 @iguanaware
A common cause for those errors is trying to access resources that do not exist.
I noticed in the appsettings.json file you have the Instance value set to "https://www.beaconcreate.net/". Do you still encounter this issue when you replace that value with "https://www.beaconcreate.b2clogin.com"?
Also for reference if you want to see PII
Add the following line of code in Startup.cs in the ConfigureServices method.
Please bare in mind this should be used only for debugging purposes.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// Show PII
IdentityModelEventSource.ShowPII = true;
// Rest of code...
});
// Rest of code...
}
No response.
Closing.
Please re-open if issue persists.
@v-michaelmi This is no longer necessary. If you use the latest Microsoft.Identity.Web, just use the "ShowPII" in the configuration cc: @kalyankrishna1 @aremo-ms
"AzureAd": {
"ShowPII" : true,
}