أنشطة "Rrader30"

إجابة

When I try I am getting

500 Internal Server Error UNAUTHORIZED_CLIENT Unknown client or client not enabled

إجابة

I am still getting the 401 error. I tried logging into the angular frontend and also authenticating within swagger

2021-12-30 10:36:25.141 -05:00 [DBG] HealthReportCollector has completed. 2021-12-30 10:36:25.141 -05:00 [DBG] HealthCheck collector HostedService executed successfully. 2021-12-30 10:36:29.735 -05:00 [INF] Request starting HTTP/2 GET https://localhost:44350/hangfire - - 2021-12-30 10:36:29.759 -05:00 [INF] Request finished HTTP/2 GET https://localhost:44350/hangfire - - - 401 - - 23.9740ms 2021-12-30 10:36:29.865 -05:00 [INF] Request starting HTTP/2 GET https://localhost:44350/hangfire - - 2021-12-30 10:36:29.868 -05:00 [INF] Request finished HTTP/2 GET https://localhost:44350/hangfire - - - 401 - - 2.4635ms

إجابة

I tried coping the code and I seem to still have an issue. How should we authenticate to get this to work?

إجابة

So I copied the code over and debugged. It appears that the issue is in the IsLoggedIn. It continues to return false. I have validated that in the Angular App I am logged in and I have tried to authenticate via Swagger. Regardless of what I do it always returns false. Should I be authenticating in a different way?

private static bool IsLoggedIn(DashboardContext context, bool enableTenant) { var currentUser = context.GetHttpContext().RequestServices.GetRequiredService<ICurrentUser>();

        if (!enableTenant)
        {
            return currentUser.IsAuthenticated && !currentUser.TenantId.HasValue;
        }

        return currentUser.IsAuthenticated;
    }
إجابة

So I tried this and I am getting 401 error on the /hangfire url

here is the log

2021-12-27 20:48:33.611 -05:00 [DBG] Added 0 entity changes to the current audit log 2021-12-27 20:48:33.612 -05:00 [INF] Executed endpoint 'Health checks' 2021-12-27 20:48:33.612 -05:00 [DBG] Added 0 entity changes to the current audit log 2021-12-27 20:48:33.612 -05:00 [INF] Received HTTP response headers after 14.962ms - 200 2021-12-27 20:48:33.612 -05:00 [INF] End processing HTTP request after 15.1008ms - 200 2021-12-27 20:48:33.612 -05:00 [INF] Request finished HTTP/1.1 GET https://localhost:44350/health-status - - - 200 - application/json 11.1714ms 2021-12-27 20:48:33.620 -05:00 [DBG] HealthReportCollector - health report execution history saved. 2021-12-27 20:48:33.620 -05:00 [DBG] HealthReport history already exists and is in the same state, updating the values. 2021-12-27 20:48:33.623 -05:00 [INF] Saved 2 entities to in-memory store. 2021-12-27 20:48:33.623 -05:00 [DBG] HealthReportCollector has completed. 2021-12-27 20:48:33.623 -05:00 [DBG] HealthCheck collector HostedService executed successfully. 2021-12-27 20:48:35.727 -05:00 [INF] Request starting HTTP/2 GET https://localhost:44350/hangfire - - 2021-12-27 20:48:35.752 -05:00 [INF] Request finished HTTP/2 GET https://localhost:44350/hangfire - - - 401 - - 24.8275ms 2021-12-27 20:48:38.551 -05:00 [INF] Entity Framework Core 6.0.1 initialized 'BackgroundJobsDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.0' with options: QuerySplittingBehavior=SplitQuery 2021-12-27 20:48:38.553 -05:00 [INF] Executed DbCommand (2ms) [Parameters=[@__p_1='?' (DbType = Int32), @__now_0='?' (DbType = DateTime2)], CommandType='"Text"', CommandTimeout='30'] SELECT TOP(@__p_1) [a].[Id], [a].[ConcurrencyStamp], [a].[CreationTime], [a].[ExtraProperties], [a].[IsAbandoned], [a].[JobArgs], [a].[JobName], [a].[LastTryTime], [a].[NextTryTime], [a].[Priority], [a].[TryCount] FROM [AbpBackgroundJobs] AS [a] WHERE ([a].[IsAbandoned] = CAST(0 AS bit)) AND ([a].[NextTryTime] <= @__now_0) ORDER BY [a].[Priority] DESC, [a].[TryCount], [a].[NextTryTime]

Here is my code

using System; using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.AspNetCore.Authentication.Google; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.MicrosoftAccount; using Microsoft.AspNetCore.Authentication.Twitter; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using TiberVendor.EntityFrameworkCore; using TiberVendor.MultiTenancy; using StackExchange.Redis; using Microsoft.OpenApi.Models; using TiberVendor.HealthChecks; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching; using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Modularity; using Volo.Abp.Swashbuckle; using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.VirtualFileSystem; using Volo.Abp.BackgroundJobs.Hangfire; using Hangfire; using Volo.Chat; using Volo.Abp.Hangfire;

namespace TiberVendor { [DependsOn( typeof(TiberVendorHttpApiModule), typeof(AbpAutofacModule), typeof(AbpCachingStackExchangeRedisModule), typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpIdentityAspNetCoreModule), typeof(TiberVendorApplicationModule), typeof(TiberVendorEntityFrameworkCoreModule), typeof(AbpSwashbuckleModule), typeof(AbpAspNetCoreSerilogModule), typeof(AbpBackgroundJobsHangfireModule) )] [DependsOn(typeof(ChatSignalRModule))] public class TiberVendorHttpApiHostModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); var hostingEnvironment = context.Services.GetHostingEnvironment();

        ConfigureUrls(configuration);
        ConfigureConventionalControllers();
        ConfigureAuthentication(context, configuration);
        ConfigureSwagger(context, configuration);
        ConfigureCache(configuration);
        ConfigureVirtualFileSystem(context);
        ConfigureRedis(context, configuration, hostingEnvironment);
        ConfigureCors(context, configuration);
        ConfigureExternalProviders(context);
        ConfigureHealthChecks(context);
        ConfigureHangfire(context, configuration);
    }

    private void ConfigureHangfire(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddHangfire(config =&gt;
        {
            config.UseSqlServerStorage(configuration.GetConnectionString("Default"));
        });
    }

    private void ConfigureHealthChecks(ServiceConfigurationContext context)
    {
        context.Services.AddTiberVendorHealthChecks();
    }

    private void ConfigureUrls(IConfiguration configuration)
    {
        Configure&lt;AppUrlOptions&gt;(options =>
        {
            options.Applications["Angular"].RootUrl = configuration["App:AngularUrl"];
            options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password";
            options.Applications["Angular"].Urls[AccountUrlNames.EmailConfirmation] = "account/email-confirmation";
        });
    }

    private void ConfigureCache(IConfiguration configuration)
    {
        Configure&lt;AbpDistributedCacheOptions&gt;(options =>
        {
            options.KeyPrefix = "TiberVendor:";
        });
    }

    private void ConfigureVirtualFileSystem(ServiceConfigurationContext context)
    {
        var hostingEnvironment = context.Services.GetHostingEnvironment();

        if (hostingEnvironment.IsDevelopment())
        {
            Configure&lt;AbpVirtualFileSystemOptions&gt;(options =>
            {
                options.FileSets.ReplaceEmbeddedByPhysical&lt;TiberVendorDomainSharedModule&gt;(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Domain.Shared", Path.DirectorySeparatorChar)));
                options.FileSets.ReplaceEmbeddedByPhysical&lt;TiberVendorDomainModule&gt;(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Domain", Path.DirectorySeparatorChar)));
                options.FileSets.ReplaceEmbeddedByPhysical&lt;TiberVendorApplicationContractsModule&gt;(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Application.Contracts", Path.DirectorySeparatorChar)));
                options.FileSets.ReplaceEmbeddedByPhysical&lt;TiberVendorApplicationModule&gt;(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Application", Path.DirectorySeparatorChar)));
                options.FileSets.ReplaceEmbeddedByPhysical&lt;TiberVendorHttpApiModule&gt;(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.HttpApi", Path.DirectorySeparatorChar)));
            });
        }
    }

    private void ConfigureConventionalControllers()
    {
        Configure&lt;AbpAspNetCoreMvcOptions&gt;(options =>
        {
            options.ConventionalControllers.Create(typeof(TiberVendorApplicationModule).Assembly);
        });
    }

    private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(options =>
            {
                options.Authority = configuration["AuthServer:Authority"];
                options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
                options.Audience = "TiberVendor";
            });
    }

    private static void ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddAbpSwaggerGenWithOAuth(
            configuration["AuthServer:Authority"],
            new Dictionary&lt;string, string&gt;
            {
                {"TiberVendor", "TiberVendor API"}
            },
            options =>
            {
                options.SwaggerDoc("v1", new OpenApiInfo {Title = "TiberVendor API", Version = "v1"});
                options.DocInclusionPredicate((docName, description) => true);
                options.CustomSchemaIds(type => type.FullName);
            });
    }

    private void ConfigureRedis(
        ServiceConfigurationContext context,
        IConfiguration configuration,
        IWebHostEnvironment hostingEnvironment)
    {
        if (!hostingEnvironment.IsDevelopment())
        {
            var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
            context.Services
                .AddDataProtection()
                .PersistKeysToStackExchangeRedis(redis, "TiberVendor-Protection-Keys");
        }
    }

    private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddCors(options =>
        {
            options.AddDefaultPolicy(builder =>
            {
                builder
                    .WithOrigins(
                        configuration["App:CorsOrigins"]
                            .Split(",", StringSplitOptions.RemoveEmptyEntries)
                            .Select(o => o.Trim().RemovePostFix("/"))
                            .ToArray()
                    )
                    .WithAbpExposedHeaders()
                    .SetIsOriginAllowedToAllowWildcardSubdomains()
                    .AllowAnyHeader()
                    .AllowAnyMethod()
                    .AllowCredentials();
            });
        });
    }

    private void ConfigureExternalProviders(ServiceConfigurationContext context)
    {
        context.Services
            .AddDynamicExternalLoginProviderOptions&lt;GoogleOptions&gt;(
                GoogleDefaults.AuthenticationScheme,
                options =>
                {
                    options.WithProperty(x => x.ClientId);
                    options.WithProperty(x => x.ClientSecret, isSecret: true);
                }
            )
            .AddDynamicExternalLoginProviderOptions&lt;MicrosoftAccountOptions&gt;(
                MicrosoftAccountDefaults.AuthenticationScheme,
                options =>
                {
                    options.WithProperty(x => x.ClientId);
                    options.WithProperty(x => x.ClientSecret, isSecret: true);
                }
            )
            .AddDynamicExternalLoginProviderOptions&lt;TwitterOptions&gt;(
                TwitterDefaults.AuthenticationScheme,
                options =>
                {
                    options.WithProperty(x => x.ConsumerKey);
                    options.WithProperty(x => x.ConsumerSecret, isSecret: true);
                }
            );
    }

    public override void OnApplicationInitialization(ApplicationInitializationContext context)
    {
        var app = context.GetApplicationBuilder();
        var env = context.GetEnvironment();

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseAbpRequestLocalization();

        if (!env.IsDevelopment())
        {
            app.UseErrorPage();
        }

        app.UseStaticFiles();
        app.UseRouting();
        app.UseCors();
        app.UseAuthentication();
        
        if (MultiTenancyConsts.IsEnabled)
        {
            app.UseMultiTenancy();
        }

        app.UseAuthorization();
        app.UseHangfireDashboard("/hangfire", new DashboardOptions
        {
            AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter(requiredPermissionName: "hangfirePerm") }
        });

        app.UseSwagger();
        app.UseAbpSwaggerUI(options =>
        {
           options.SwaggerEndpoint("/swagger/v1/swagger.json", "TiberVendor API");

           var configuration = context.GetConfiguration();
           options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
           options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
        });
        app.UseAuditing();
        app.UseAbpSerilogEnrichers();
        app.UseUnitOfWork();
        app.UseConfiguredEndpoints();
        //app.UseHangfireDashboard();
        
    }
}

}

إجابة

All configuration is in the HttpApiHostModule.cs in the HttpApi.Host project

using System; using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.AspNetCore.Authentication.Google; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.MicrosoftAccount; using Microsoft.AspNetCore.Authentication.Twitter; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using TiberVendor.EntityFrameworkCore; using TiberVendor.MultiTenancy; using StackExchange.Redis; using Microsoft.OpenApi.Models; using TiberVendor.HealthChecks; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching; using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Modularity; using Volo.Abp.Swashbuckle; using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.VirtualFileSystem; using Volo.Abp.BackgroundJobs.Hangfire; using Hangfire; using Volo.Chat; using Volo.Abp.Hangfire; namespace TiberVendor { [DependsOn( typeof(TiberVendorHttpApiModule), typeof(AbpAutofacModule), typeof(AbpCachingStackExchangeRedisModule), typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpIdentityAspNetCoreModule), typeof(TiberVendorApplicationModule), typeof(TiberVendorEntityFrameworkCoreModule), typeof(AbpSwashbuckleModule), typeof(AbpAspNetCoreSerilogModule), typeof(AbpBackgroundJobsHangfireModule) )] [DependsOn(typeof(ChatSignalRModule))] public class TiberVendorHttpApiHostModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); var hostingEnvironment = context.Services.GetHostingEnvironment(); ConfigureUrls(configuration); ConfigureConventionalControllers(); ConfigureAuthentication(context, configuration); ConfigureSwagger(context, configuration); ConfigureCache(configuration); ConfigureVirtualFileSystem(context); ConfigureRedis(context, configuration, hostingEnvironment); ConfigureCors(context, configuration); ConfigureExternalProviders(context); ConfigureHealthChecks(context); ConfigureHangfire(context, configuration); } private void ConfigureHangfire(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddHangfire(config => { config.UseSqlServerStorage(configuration.GetConnectionString("Default")); }); } private void ConfigureHealthChecks(ServiceConfigurationContext context) { context.Services.AddTiberVendorHealthChecks(); } private void ConfigureUrls(IConfiguration configuration) { Configure<AppUrlOptions>(options => { options.Applications["Angular"].RootUrl = configuration["App:AngularUrl"]; options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; options.Applications["Angular"].Urls[AccountUrlNames.EmailConfirmation] = "account/email-confirmation"; }); } private void ConfigureCache(IConfiguration configuration) { Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "TiberVendor:"; }); } private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) { var hostingEnvironment = context.Services.GetHostingEnvironment(); if (hostingEnvironment.IsDevelopment()) { Configure<AbpVirtualFileSystemOptions>(options => { options.FileSets.ReplaceEmbeddedByPhysical<TiberVendorDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Domain.Shared", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical<TiberVendorDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Domain", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical<TiberVendorApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Application.Contracts", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical<TiberVendorApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.Application", Path.DirectorySeparatorChar))); options.FileSets.ReplaceEmbeddedByPhysical<TiberVendorHttpApiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}TiberVendor.HttpApi", Path.DirectorySeparatorChar))); }); } } private void ConfigureConventionalControllers() { Configure<AbpAspNetCoreMvcOptions>(options => { options.ConventionalControllers.Create(typeof(TiberVendorApplicationModule).Assembly); }); } private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.Authority = configuration["AuthServer:Authority"]; options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); options.Audience = "TiberVendor"; }); } private static void ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddAbpSwaggerGenWithOAuth( configuration["AuthServer:Authority"], new Dictionary<string, string> { {"TiberVendor", "TiberVendor API"} }, options => { options.SwaggerDoc("v1", new OpenApiInfo {Title = "TiberVendor API", Version = "v1"}); options.DocInclusionPredicate((docName, description) => true); options.CustomSchemaIds(type => type.FullName); }); } private void ConfigureRedis( ServiceConfigurationContext context, IConfiguration configuration, IWebHostEnvironment hostingEnvironment) { if (!hostingEnvironment.IsDevelopment()) { var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); context.Services .AddDataProtection() .PersistKeysToStackExchangeRedis(redis, "TiberVendor-Protection-Keys"); } } private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) { context.Services.AddCors(options => { options.AddDefaultPolicy(builder => { builder .WithOrigins( configuration["App:CorsOrigins"] .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.Trim().RemovePostFix("/")) .ToArray() ) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); }); }); } private void ConfigureExternalProviders(ServiceConfigurationContext context) { context.Services .AddDynamicExternalLoginProviderOptions<GoogleOptions>( GoogleDefaults.AuthenticationScheme, options => { options.WithProperty(x => x.ClientId); options.WithProperty(x => x.ClientSecret, isSecret: true); } ) .AddDynamicExternalLoginProviderOptions<MicrosoftAccountOptions>( MicrosoftAccountDefaults.AuthenticationScheme, options => { options.WithProperty(x => x.ClientId); options.WithProperty(x => x.ClientSecret, isSecret: true); } ) .AddDynamicExternalLoginProviderOptions<TwitterOptions>( TwitterDefaults.AuthenticationScheme, options => { options.WithProperty(x => x.ConsumerKey); options.WithProperty(x => x.ConsumerSecret, isSecret: true); } ); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseAbpRequestLocalization(); if (!env.IsDevelopment()) { app.UseErrorPage(); } app.UseStaticFiles(); app.UseRouting(); app.UseCors(); app.UseAuthentication(); if (MultiTenancyConsts.IsEnabled) { app.UseMultiTenancy(); } app.UseAuthorization(); app.UseSwagger(); app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "TiberVendor API"); var configuration = context.GetConfiguration(); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); app.UseUnitOfWork(); app.UseConfiguredEndpoints(); app.UseHangfireDashboard(); //app.UseHangfireDashboard("/hangfire",new DashboardOptions //{ // AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter(requiredPermissionName: "hangfirePerm") } //}); } } }

إجابة

I seen this and tried following it. When I define the parameters for using authorization the hangfire url stops working but not supplying parameters everything works

إجابة

it appears changing these worked. However, I am running into another upgrade issue.

I have added this line of code to my HostApi.Host startup.cs

app.UseHangfireDashboard("/hangfire",new DashboardOptions { AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter(requiredPermissionName: "hangfirePerm") } });

When I try to access hangfire on /hangfire I get page can not be found error. log file entries are below.

SELECT TOP(@__p_1) [a].[Id], [a].[ConcurrencyStamp], [a].[CreationTime], [a].[ExtraProperties], [a].[IsAbandoned], [a].[JobArgs], [a].[JobName], [a].[LastTryTime], [a].[NextTryTime], [a].[Priority], [a].[TryCount] FROM [AbpBackgroundJobs] AS [a] WHERE ([a].[IsAbandoned] = CAST(0 AS bit)) AND ([a].[NextTryTime] <= @__now_0) ORDER BY [a].[Priority] DESC, [a].[TryCount], [a].[NextTryTime] 2021-12-27 09:21:55.711 -05:00 [INF] Request starting HTTP/2 GET https://localhost:44350/hangfire - - 2021-12-27 09:21:55.713 -05:00 [INF] Request finished HTTP/2 GET https://localhost:44350/hangfire - - - 401 - - 2.2855ms 2021-12-27 09:21:59.831 -05:00 [INF] Entity Framework Core 6.0.1 initialized 'BackgroundJobsDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer:6.0.0' with options: QuerySplittingBehavior=SplitQuery 2021-12-27 09:21:59.832 -05:00 [INF] Executed DbCommand (1ms) [Parameters=[@__p_1='?' (DbType = Int32), @__now_0='?' (DbType = DateTime2)], CommandType='"Text"', CommandTimeout='30'] SELECT TOP(@__p_1) [a].[Id], [a].[ConcurrencyStamp], [a].[CreationTime], [a].[ExtraProperties], [a].[IsAbandoned], [a].[JobArgs], [a].[JobName], [a].[LastTryTime], [a].[NextTryTime], [a].[Priority], [a].[TryCount] FROM [AbpBackgroundJobs] AS [a] WHERE ([a].[IsAbandoned] = CAST(0 AS bit)) AND ([a].[NextTryTime] <= @__now_0) ORDER BY [a].[Priority] DESC, [a].[TryCount], [a].[NextTryTime]

If I change the code back to app.UseHangfireDashboard(); things appear to be working properly. What could be missing?

إجابة

When you say use. Are you referring to referring the package in one of the projects or something else?

Since this is mainly ABP code. Where should I look and compare?

عرض 11 الي 20 من 33 إدخالات
Made with ❤️ on ABP v8.2.0-preview Updated on مارس 25, 2024, 15:11