Activities of "alexiscenriquez"

Hi, I have followed the examples; however there are none for ng tiered, so I have been trying to combine code from the MVC tiered and angular, but nothing has resolved the issue thus far.

  • ABP Framework version: v9.0.3
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue: I'm having trouble getting my tenant domain resolver to work correctly. When I visit the tenant subdomain (e.g., http://tenant.mydomain:4200) and click the login button, I'm redirected to the correct authentication server URL with the tenant subdomain. However, I'm unable to log in as a tenant user.

I can log in as the host admin, but doing so signs me into the host account instead of the tenant account. I also noticed that when I first visit the tenant subdomain, abpSession in local storage contains tenant-related data, but this data is lost once I navigate to the authentication server. Additionally, I set breakpoints in my login component and found that ICurrentTenant is null.

Any ideas on what might be causing this issue?

AuthServerModule

 public override void PreConfigureServices(ServiceConfigurationContext context)
 {
     var hostingEnvironment = context.Services.GetHostingEnvironment();
     var configuration = context.Services.GetConfiguration();

     PreConfigure<OpenIddictBuilder>(builder =>
     {
         builder.AddValidation(options =>
         {
             options.AddAudiences("Bookstore");
             options.UseLocalServer();
             options.UseAspNetCore();
         });
     });

     if (!hostingEnvironment.IsDevelopment())
     {
         PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
         {
             options.AddDevelopmentEncryptionAndSigningCertificate = false;
         });

         PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
         {
             serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", configuration["AuthServer:CertificatePassPhrase"]!);
             serverBuilder.SetIssuer(new Uri(configuration["AuthServer:Authority"]!));
         });
     }

     PreConfigure<AbpOpenIddictWildcardDomainOptions>(options =>
     {
         options.EnableWildcardDomainSupport = true;
         options.WildcardDomainsFormat.Add(configuration["WildcardDomains:API"]);
         options.WildcardDomainsFormat.Add(configuration["WildcardDomains:Angular"]!);
         options.WildcardDomainsFormat.Add(configuration["WildcardDomains:AuthServer"]);
     });
 }

 public override void ConfigureServices(ServiceConfigurationContext context)
 {
     var hostingEnvironment = context.Services.GetHostingEnvironment();
     var configuration = context.Services.GetConfiguration();

     Configure<AbpTenantResolveOptions>(options =>
     {
         options.AddDomainTenantResolver(configuration["WildcardDomains:AuthServer"]!);
         options.AddDomainTenantResolver(configuration["WildcardDomains:API"]!);
         options.AddDomainTenantResolver(configuration["WildcardDomains:Angular"]!);
     });
     Configure<OpenIddictServerOptions>(options =>
     {
         options.TokenValidationParameters.IssuerValidator = TokenWildcardIssuerValidator.IssuerValidator;
         options.TokenValidationParameters.ValidIssuers = new[] { $"{configuration["WildcardDomains:AuthServer"]}/", $"{configuration["App:SelfUrl"]}/" };
     });

HttpApiHostModule

private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(options =>
            {
                options.Authority = configuration["AuthServer:Authority"] + "/" ;
                options.RequireHttpsMetadata = configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata");
                options.Audience = "Bookstore";
            });
        Configure<AbpTenantResolveOptions>(options =>
        {
            options.AddDomainTenantResolver(configuration["WildcardDomains:AuthServer"]);
            options.AddDomainTenantResolver(configuration["WildcardDomains:Angular"]);
            options.AddDomainTenantResolver(configuration["WildcardDomains:API"]);
        });
        context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
        {
            options.IsDynamicClaimsEnabled = true;
        });
    }
Showing 1 to 2 of 2 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13