Hi,
Only BackgroundJobWorker is operating the AbpBackgroundJobs table
https://github.com/abpframework/abp/blob/rel-8.0/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs#L42-L112
It will try to retry to execute the Job If an exception occurs. When the max retry count is reached, it will abandon the job without logging the exception https://github.com/abpframework/abp/blob/rel-8.0/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/BackgroundJobWorker.cs#L82
Hi,
I guess you are looking for this https://docs.abp.io/en/abp/latest/String-Encryption
Hi,
You can use the URL:
https://localhost:44387/Account/Login?returnUrl=http://localhost:4200/account/login&__tenant=test
You can add the object mapper config if you need: https://docs.abp.io/en/abp/latest/Object-To-Object-Mapping#define-mappings
Hi,
You can try this:
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IUserExceptionInformer))]
public class MyUserExceptionInformer : IUserExceptionInformer, IScopedDependency
{
protected IHttpContextAccessor HttpContextAccessor { get; }
public ILogger<UserExceptionInformer> Logger { get; set; }
protected IUiMessageService MessageService { get; }
protected IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; }
protected AbpExceptionHandlingOptions Options { get; }
protected IJSRuntime JsRuntime { get; }
public MyUserExceptionInformer(
IUiMessageService messageService,
IExceptionToErrorInfoConverter exceptionToErrorInfoConverter,
IOptions<AbpExceptionHandlingOptions> options,
IHttpContextAccessor httpContextAccessor, IJSRuntime jsRuntime)
{
MessageService = messageService;
ExceptionToErrorInfoConverter = exceptionToErrorInfoConverter;
Options = options.Value;
Logger = NullLogger<UserExceptionInformer>.Instance;
HttpContextAccessor = httpContextAccessor;
JsRuntime = jsRuntime;
}
public new void Inform(UserExceptionInformerContext context)
{
//TODO: Create sync versions of the MessageService APIs.
var errorInfo = GetErrorInfo(context);
if (errorInfo.Details.IsNullOrEmpty())
{
MessageService.Error(errorInfo.Message!);
}
else
{
MessageService.Error(errorInfo.Details!, errorInfo.Message);
}
}
public new async Task InformAsync(UserExceptionInformerContext context)
{
var errorInfo = GetErrorInfo(context);
if (errorInfo.Message == "Unauthorized")
{
var httpContext = HttpContextAccessor.HttpContext;
var openIdConnectOptions = httpContext.RequestServices.GetRequiredService<IOptionsMonitor<OpenIdConnectOptions>>().Get("oidc");
var response = await openIdConnectOptions.Backchannel.IntrospectTokenAsync(new TokenIntrospectionRequest
{
Address = openIdConnectOptions.Configuration?.IntrospectionEndpoint ?? openIdConnectOptions.Authority!.EnsureEndsWith('/') + "connect/introspect",
ClientId = openIdConnectOptions.ClientId!,
ClientSecret = openIdConnectOptions.ClientSecret,
Token = await httpContext.GetTokenAsync("access_token")
});
if (response.IsError || !response.IsActive)
{
// handle the token is not active
await JsRuntime.InvokeVoidAsync("eval", "window.location.href = '/Account/Logout';");
}
return;
}
if (errorInfo.Details.IsNullOrEmpty())
{
await MessageService.Error(errorInfo.Message!);
}
else
{
await MessageService.Error(errorInfo.Details!, errorInfo.Message);
}
}
protected virtual RemoteServiceErrorInfo GetErrorInfo(UserExceptionInformerContext context)
{
return ExceptionToErrorInfoConverter.Convert(context.Exception, options =>
{
options.SendExceptionsDetailsToClients = Options.SendExceptionsDetailsToClients;
options.SendStackTraceToClients = Options.SendStackTraceToClients;
});
}
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.RemoveAll(x => x.ImplementationType == typeof(UserExceptionInformer));
}
If it is allowed anonymous access, you can add the [AllowAnonymous] to the method.
Update ClaimsDbContext.
[ConnectionStringName(ClaimsDbProperties.ConnectionStringName)]
[ReplaceDbContext(typeof(IIntermediaryDbContext))]
public class ClaimsDbContext : AbpDbContext<ClaimsDbContext>, IClaimsDbContext, IIntermediaryDbContext
{
public DbSet<Claim> Claims { get; set; } = null!;
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
....
public ClaimsDbContext(DbContextOptions<ClaimsDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureIntermediary();
builder.ConfigureClaims();
}
}
Hi,
add typeof(IntermediaryEntityFrameworkCoreModule) to ClaimsEntityFrameworkCoreModule
add builder.ConfigureIntermediary(); to the ClaimsDbContext
2024-04-11 05:58:20.329 +04:00 [WRN] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.", "details": "UserFriendlyException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.\r\nSTACK TRACE: at MyDhobi.Verify.VerifiationProcessService.PostUpdatePassword(UpdatePasswordDto input) in
Seems like you don't have the permission, make sure the permission is assigned.