question

SantiagoEsteawensTorresZapata-4585 avatar image
0 Votes"
SantiagoEsteawensTorresZapata-4585 asked JasonKaulbfliesch-9433 commented

Error Uri is null EditProfile B2C .Net

Hi,

I have a project MVC in .Net Core 5 this connect to Azure AD B2C, all it works, but in the Edit button sometimes returned following error:

Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler[12]
Message contains error: 'server_error', error_description: 'AADB2C: An exception has occurred.
Correlation ID: c64a6070-e437-4373-905c-e1db69035e56
Timestamp: 2021-10-11 21:05:48Z
', error_uri: 'error_uri is null'.

Below the configuration in Startup.cs file:

     public class Startup
     {
         public Startup(IConfiguration configuration)
         {
             Configuration = configuration;
         }
    
         public IConfiguration Configuration { get; }
    
         // This method gets called by the runtime. Use this method to add services to the container.
         public void ConfigureServices(IServiceCollection services)
         {
             services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
                 .AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAdB2C"));
    
             services.AddControllersWithViews(options =>
             {
                 var policy = new AuthorizationPolicyBuilder()
                     .RequireAuthenticatedUser()
                     .Build();
                 options.Filters.Add(new AuthorizeFilter(policy));
    
                 var user = new AuthorizationPolicyBuilder()
                     .RequireAuthenticatedUser()
                     .Build();
             });
             services.AddRazorPages()
                  .AddMicrosoftIdentityUI();
    
             services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>
             {
                 var previousOptions = options.Events.OnRedirectToIdentityProvider;
                 options.Events.OnRedirectToIdentityProvider = async context =>
                 {
                     await previousOptions(context);
                     context.ProtocolMessage.ResponseType = Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectResponseType.IdToken;
                 };
             });
    
             services.Configure<ForwardedHeadersOptions>(options =>
             {
                 options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
                 options.KnownNetworks.Clear();
                 options.KnownProxies.Clear();
             });            
    
             services.Configure<CookiePolicyOptions>(options =>
             {
                 options.CheckConsentNeeded = context => true;
                 options.MinimumSameSitePolicy = SameSiteMode.None;
                 options.Secure = CookieSecurePolicy.Always;
                 options.HandleSameSiteCookieCompatibility();
             });
         }
    
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
         {
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();
             }
             else
             {
                 app.UseExceptionHandler("/Home/Error");
                 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                 app.UseHsts();
             }
             app.UseHttpsRedirection();
             app.UseStaticFiles();
    
             app.UseRouting();
    
             app.UseAuthentication();
             app.UseAuthorization();
    
             app.UseForwardedHeaders();
    
             app.UseEndpoints(endpoints =>
             {
                 endpoints.MapControllerRoute(
                     name: "default",
                     pattern: "{controller=Home}/{action=Index}/{id?}");
                 endpoints.MapRazorPages();
             });
         }
     }

Any idea for this error.

I really appreciate it.



azure-ad-b2c
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SantiagoEsteawensTorresZapata-4585,

Thanks for reaching out and apologies for any inconvenience caused by above issue.

This seems to be related with temporary glitch caused by backend issue and our engineering team have already developed a fix but waiting for production deployment. I will keep you updated. Thanks.

2 Votes 2 ·

The edit button works if I rerun it.

1 Vote 1 ·
sikumars avatar image sikumars SantiagoEsteawensTorresZapata-4585 ·

Confirmed with engineering team and fix should be rolled out to all Datacenters by end of this week.
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.

0 Votes 0 ·
sikumars avatar image
0 Votes"
sikumars answered sikumars edited

Hello @SantiagoEsteawensTorresZapata-4585,

Thanks for reaching out and apologies for any inconvenience caused by above issue.


This seems to be related with glitch caused by backend issue and our engineering team have already developed a fix which should be rolled out to all Datacenters by end of this week.

We have already verified fix with new tenant which is all working as expected without any issue.

If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.

Hope this helps.


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JasonKaulbfliesch-9433 avatar image
0 Votes"
JasonKaulbfliesch-9433 answered JasonKaulbfliesch-9433 published

I've been having the same issue, only started recently. hitting the standard passwordreset userflow.

Error.
An error occurred while processing your request.
Request ID: |89b83d59-43878148111a70cb.

Details
Message contains error: 'server_error', error_description: 'AADB2C: An exception has occurred. Correlation ID: 041fa9ca-db65-4eaf-a266-cf3dc171ec55 Timestamp: 2021-10-13 11:26:29Z ', error_uri: 'error_uri is null'.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JasonKaulbfliesch-9433 avatar image
0 Votes"
JasonKaulbfliesch-9433 answered JasonKaulbfliesch-9433 commented

Does anyone know if the fix has been applied ?

Still getting errors.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

all week it has worked very well for me

0 Votes 0 ·

Fix has been deployed10 days ago and this issue shouldn't appear however if issue persist for you then I would recommend to reach out MS support who can help you isolate the issue. Thanks.

0 Votes 0 ·

Thank you

0 Votes 0 ·