Open Closed

Handling Azure AD B2C error message containing the error code -AADB2C90091.** #5086


User avatar
0
madklm_16 created

ABP Framework version:** v6.0.0

UI type: Angular

DB provider: EF Core

Tiered (MVC) or Identity Server Separated (Angular): yes / no

Exception message and stack trace:

Steps to reproduce the issue:" Handling Azure AD B2C error message containing the error code -AADB2C90091. I am trying to handle one of the specific errors returned from Azure Ad B2C , error code -AADB2C90091. (user cancelled sign up / login flow) I have tried hooking up to OnAuthenticationFailed in option.Events in the configuration. But it doesnt seem to flow there. Is there anything else I need to be doing to catch this ?


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    What is your Azure AD B2C code?

  • User Avatar
    0
    madklm_16 created

    .AddOpenIdConnect("OpenIdConnect", "Azure B2C OpenId", options => { options.SignInScheme = IdentityConstants.ExternalScheme; options.SignOutScheme = IdentityConstants.ExternalScheme; options.ForwardChallenge = "OpenIdConnect";

                options.ClientId = configuration["Authentication:OpenId:ClientId"];
                options.Authority = string.Format(configuration["Authentication:OpenId:Authority"], configuration["Authentication:OpenId:TenantId"]);
                options.SignedOutRedirectUri = new Uri(configuration["App:AngularUrl"]).ToString();
               
                options.ResponseType = OpenIdConnectResponseType.IdToken;
    
                options.SaveTokens = true;
    
                options.MetadataAddress = new Uri(string.Format(configuration["Authentication:OpenId:SignInSignUpPolicyUrl"], configuration["Authentication:OpenId:TenantId"])).ToString();
    
                options.GetClaimsFromUserInfoEndpoint = true;
    
                options.Scope.Add("email");
                options.ClaimActions.MapAll();
                
    
                options.Events = new OpenIdConnectEvents()
                {
                    OnTokenValidated = (tokenValidatedContext) =>
                    {
                        
    
    
                        return Task.FromResult(0);
                    },
                    }
                    }
            
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the logs of your app.

    Maybe it can't handle the cancel event

    https://github.com/dotnet/aspnetcore/blob/1b15d0e92f139d853b5a1b740cd571d9d08e672f/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectHandler.cs#L789

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11