Open Closed

Azure Login is not working in new version of ABP #1053


User avatar
0
safi created

Hi

In my old project azure login was working but I have upgraded all the packages from abp suite and all things are working fine. Now azure login is not working it's redirecting back to login page after azure login.

To check this issue I have created a sample project from abp suite and just added the azure settings into host appsettings.json file and added below code in hostmodule.cs class.

  private static void ConfigureAzureLogin(ServiceConfigurationContext context, IConfiguration configuration)
        {
            context.Services.AddAuthentication().AddOpenIdConnect("AzureOpenId", "Azure", options =>
            {
                options.Authority = "https://login.microsoftonline.com/" + configuration["AzureAd:TenantId"] + "/v2.0/";
                options.ClientId = configuration["AzureAd:ClientId"];
                options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
                options.CallbackPath = configuration["AzureAd:CallbackPath"];
                options.ClientSecret = configuration["AzureAd:ClientSecret"];
                options.RequireHttpsMetadata = false;
                options.SaveTokens = true;
                options.GetClaimsFromUserInfoEndpoint = true;
                options.Scope.Add("email");

                //options.Events.OnTokenValidated = (async context =>
                //{
                //    var debugIdentityPrincipal = context.Principal.Identity;
                //    var claimsFromOidcProvider = context.Principal.Claims.ToList();
                //});
            });
        }

Now login button is coming, azure login screen is coming but after entring the credential it's redirecting to login page again. Not able to understand the reason because same code is working in ABP 4.1.1 version but it's not working in ABP 4.2.2. Please suggest me some solution for the same it's quite urgent.

Reference Link : https://community.abp.io/articles/how-to-setup-azure-active-directory-and-integrate-abp-angular-application-lyk87w5l

Thanks,

  • ABP Framework version: v4.2.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: not getting any error
  • Steps to reproduce the issue: Create sample project and add azure settings into appsettings.json file under host project.

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

    hi

    Can you check your application logs? it should contain some messages.

  • User Avatar
    0
    safi created

    Hi

    I have checked log.txt file so no error is coming but attaching screenshot so please check and connect me on zoom. It's really urgent my site is down due to this.

    Thanks,

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    To check this issue I have created a sample project from abp suite

    This is like a configuration problem, please check the configuration of your application. Such as CORS

  • User Avatar
    0
    safi created

    Hi

    There is no change in configuration same code is working in ABP4.1.1. version and you will also face this issue. You can download sample project from site and add azure settings into .json file then you will get this issue.

    Thanks,

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://zoom.us/j/97304828768?pwd=czI1aHJIZG9iSGo2OUY5aWRxeHhzQT09

  • User Avatar
    0
    safi created

    It's showing me invalid meeting id.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Try agagin.

  • User Avatar
    0
    safi created

    Still same invalid meeting id

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @safi

    You can host a meeting. I will join.

  • User Avatar
    0
    safi created

    Hi

    Please join here https://zoom.us/j/92794106923?pwd=MC9pOUZBNldueVBPNkcrYzVjckxPUT09

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you provide me with a test username and password? liming.ma@volosoft.com

  • User Avatar
    0
    safi created

    Hi

    I don't have test credentials.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you create a test user?

  • User Avatar
    0
    safi created

    Hi

    Created test user...please share your email id so that I can share.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    liming.ma@volosoft.com

  • User Avatar
    0
    safi created

    liming.ma@volosoft.com

    just sent the mail

  • User Avatar
    0
    safi created

    Hi

    Going to provide you access now.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer
    Request Id: c83fae52-a82a-41af-ba52-5cf120e4a200
    Correlation Id: f7f25463-7b4f-47b5-b283-c897ae289947
    Timestamp: 2021-03-17T11:50:14Z
    Message: AADSTS90072: User account 'test4844@outlook.com' from identity provider 'live.com' does not exist in tenant 'Adappt Limited' and cannot access the application 'ed6923ba-af15-4a10-ac56-20f1ba29cec0'(InternalDevelopment-WHOEIOS) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account
    
  • User Avatar
    0
    safi created

    Hi

    Issue is resolved now.

    Thanks,

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38