Activities of "dhill"

I created this class in the Blazor.Client project root directory. Is there a syntax to register it in the module startup?

using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Volo.Abp.Http.Client;
using Volo.Abp.MultiTenancy;

namespace SafetyPlusWeb;

public class MyRemoteServiceConfigurationProvider(IOptionsMonitor<AbpRemoteServiceOptions> options, IMultiTenantUrlProvider multiTenantUrlProvider, ICurrentTenant currentTenant) : RemoteServiceConfigurationProvider(options, multiTenantUrlProvider, currentTenant)
{
    protected override async Task<RemoteServiceConfiguration?> GetMultiTenantConfigurationAsync(RemoteServiceConfiguration? configuration)
    {
        if (configuration == null)
            return configuration;

        var baseUrl = await MultiTenantUrlProvider.GetUrlAsync(configuration.BaseUrl);
        if (baseUrl == configuration.BaseUrl)
            return configuration;

        var multiTenantConfiguration = new RemoteServiceConfiguration(configuration)
        {
            BaseUrl = baseUrl
        };

        return multiTenantConfiguration;
    }
}

I loaded the symbols but the breakpoints don't ever get hit.

I changed the appsettings.json Blazor.Client to the following but we're still facing the same issue.

{ "RemoteServices": { "Default": { "BaseUrl": "https://{0}.xxxxxxplus-xxx.com" } }, "AbpCli": { "Bundle": { "Mode": "BundleAndMinify", "Name": "global", "IsBlazorWebApp": true, "InteractiveAuto": true, "Parameters": { "LeptonXTheme.Layout": "side-menu" } } } }

Hi,

I tried adding that code but it didn't actually refresh the url in the browser.

Is this something that has to happen on the client wasm side with blazor full stack?

Hi,

Do you mean to try that as a test?

The application is multi-tenant so that wouldn't work for all of the different clients.

Also, I ran some tests with this code and although it adds a cookie with the '.' prefix it doesn't prevent the site from crashing.

console.log("myleptonx.js loaded");

function setCookie(name, value, domain, day = 365) {
    var expires = new Date();
    expires.setTime(expires.getTime() + (day * 24 * 60 * 60 * 1000));
    //prefix domain with '.' to make it work for subdomains
    document.cookie = name + '=' + value + ';expires=' + expires.toUTCString() + ';domain=.' + domain + ';path=/';
}

// Remove default event listener from leptonx theme in global.js
document.body.removeEventListener('on', leptonx.AppearanceSettingEvent);

// Hardcode to app.localhost for local testing
setCookie("lpx_loaded-css", "dark", "app.localhost");


// Add new event listener to leptonx theme with subdomain cookie
//leptonx.AppearanceSettingEvent.on(document.body, evnet => {
//    var theme = evnet.detail.theme;

//    setCookie("lpx_loaded-css", theme, "app.localhost");
//    setCookie("lpx_appearance", theme, "app.localhost");
//});
  • ABP Framework version: v8.2.0
  • UI Type: Blazor Web App
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Steps to reproduce the issue:

Subdomain tenant mapping is not working correctly after converting a Blazor Server to Blazor Web App.

Behavior Initially a user can login to the tenant as normal but after a couple minutes the session will force a logout.

Partial Console Logs:

dotnet.runtime.8.0.7.3bvrr6lyon.js:3  warn: Volo.Abp.IdentityModel.IdentityModelAuthenticationService[0]
      Could not find IdentityClientConfiguration for AbpMvcClient. Either define a configuration for AbpMvcClient or set a default configuration.
(anonymous) @ dotnet.runtime.8.0.7.3bvrr6lyon.js:3
dotnet.runtime.8.0.7.3bvrr6lyon.js:3 info: System.Net.Http.HttpClient.AbpMvcClient.LogicalHandler[100]
      Start processing HTTP request GET https://redacted.com/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0
dotnet.runtime.8.0.7.3bvrr6lyon.js:3 info: System.Net.Http.HttpClient.AbpMvcClient.ClientHandler[100]
      Sending HTTP request GET https://redacted.com/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0
dotnet.runtime.8.0.7.3bvrr6lyon.js:3 info: System.Net.Http.HttpClient.AbpMvcClient.ClientHandler[101]
      Received HTTP response headers after 160.1ms - 200
dotnet.runtime.8.0.7.3bvrr6lyon.js:3 info: System.Net.Http.HttpClient.AbpMvcClient.LogicalHandler[101]
      End processing HTTP request after 188.2ms - 200
dotnet.runtime.8.0.7.3bvrr6lyon.js:3  warn: Volo.Abp.IdentityModel.IdentityModelAuthenticationService[0]
      Could not find IdentityClientConfiguration for AbpMvcClient. Either define a configuration for AbpMvcClient or set a default configuration.
dotnet.runtime.8.0.7.3bvrr6lyon.js:3 info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed. These requirements were not met:
      DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

Application Insights Logs

This issue does not present when logging into the main (admin) site. If subdomain tenant mapping is disabled the application works correctly.

Module Configuration Redacted.Blazor ---> RedactedBlazorModule.cs

  • ABP Framework version: v8.2.0
  • UI Type: Blazor Server
  • Database System: EF Core
  • **Azure Web App with AzureSignalR We've successfully implemented subdomain tenant mapping. However, when using linked accounts the subdomain does not change when the tenant change happens. How can we get the subdomain url to reflect the change in tentant?

Here is our WebModule configuration.

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

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

            PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
            {
                // In production, it is recommended to use two RSA certificates, 
                // one for encryption, one for signing.
                _ = serverBuilder.AddEncryptionCertificate(
                        GetEncryptionCertificate(context.Services.GetConfiguration()));
                _ = serverBuilder.AddSigningCertificate(
                        GetSigningCertificate(context.Services.GetConfiguration()));
            });

            var domainFormat = GetDomainFormatForEnvironment(hostingEnvironment);
            PreConfigure<AbpOpenIddictWildcardDomainOptions>(options =>
            {
                options.EnableWildcardDomainSupport = true;
                _ = options.WildcardDomainsFormat.Add($"https://{domainFormat}");
                _ = options.WildcardDomainsFormat.Add($"https://{domainFormat}/signin-oidc");
                _ = options.WildcardDomainsFormat.Add($"https://{domainFormat}/signout-callback-oidc");
            });
        }
    }

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

        var domainFormat = GetDomainFormatForEnvironment(hostingEnvironment);

        Configure<AbpTenantResolveOptions>(options =>
        {
            options.AddDomainTenantResolver(domainFormat);
        });

        if (!configuration.GetValue<bool>("App:DisablePII"))
        {
            Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
        }

        if (!configuration.GetValue<bool>("AuthServer:RequireHttpsMetadata"))
        {
            Configure<OpenIddictServerAspNetCoreOptions>(options =>
            {
                options.DisableTransportSecurityRequirement = true;
            });
        }

        if (!hostingEnvironment.IsDevelopment())
        {
            _ = context.Services.AddSignalR(options =>
            {
                options.AddFilter<AbpMultiTenantHubFilter>();
            }).AddAzureSignalR();
        }

        ConfigureOptions(context, configuration);
        ConfigureAuthentication(context);
        ConfigureUrls(configuration);
        ConfigureBundles();
        ConfigureImpersonation(context, configuration);
        ConfigureAutoMapper();
        ConfigureVirtualFileSystem(hostingEnvironment);
        ConfigureMultiTenancy();
        ConfigureSwaggerServices(context.Services);
        ConfigureExternalProviders(context, configuration);
        ConfigureAutoApiControllers();
        ConfigureBlazorise(context);
        ConfigureRouter(context);
        ConfigureMenu(context);
        ConfigureCookieConsent(context);
        ConfigureAuditingOptions(context);
        ConfigureTheme();

        Configure<SettingManagementComponentOptions>(options =>
        {
            options.Contributors.Add(new SafetyPlusWebSettingsComponentContributor());
        });

        if (!hostingEnvironment.IsDevelopment())
        {
            Configure<AbpTenantResolveOptions>(options =>
            {
                options.AddDomainTenantResolver(domainFormat);
            });
        }
    }
    ```

We really need to understand better how to interact with the file management APIs so as to override them.

Managing permissions isn't the requirement here. We need support in applying permissions against the module.

Can we get some basic documentation and or explanation of how the module works?

The wiki is very limited on this module.

Hi

It makes sense how to add permissions but what we need help with is where do we apply the permissions on a file by file basis?

How do we mark a file as confidential for example and then based on a permission filter it out from being viewable in the directory tree?

Can you give some guidance on a good place to start interacting with the existing code?

Can we override any existing classes?

Showing 31 to 40 of 56 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13