hi
Your code is different from our template.
https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs#L211-L233
https://github.com/abpframework/abp/blob/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs#L191-L226
The UseConfiguredEndpoints have to be the last middleware.
See https://github.com/HangfireIO/Hangfire/pull/2350
hi
** If there are calls to app.UseRouting() and app.UseEndpoints(...), the call to app.UseAuthorization() must go between them.**
is this correct?
No. Please check https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs#L211-L233
hi
What are the logs of the AuthServer project?
hi
This is an integrated app service from PermissionManagement.
https://github.com/abpframework/abp/blob/dev/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/Integration/IPermissionIntegrationService.cs#L9
You can use it to check the permissions. it exists on administration service.
https://docs.abp.io/en/commercial/latest/startup-templates/microservice/synchronous-interservice-communication
hi
What is the response when you call this API from Angular when email already exists?
hi
Please adjust the order of your middleware based on https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.AuthServer/MyProjectNameAuthServerModule.cs#L211-L233
hi
You can use IPermissionIntegrationService to check userId's permissions.
public class IsGrantedRequest
{
public Guid UserId { get; set; }
public string[] PermissionNames { get; set; }
}
hi
Can you try this?
If it still doesn't work, please share a project that I can run.
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseForwardedHeaders();
// Configure the HTTP request pipeline.
if (env.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
// app.UseHsts();
}
app.UseHsts();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseHangfireDashboard("", new DashboardOptions
{
Authorization = new[] { new HangfireCustomBasicAuthenticationFilter { User = "admin", Pass = "123321" } }
});
var hostEnvironment = context.ServiceProvider.GetRequiredService<IHostEnvironment>();
InitJobs.Setup(hostEnvironment);
app.UseConfiguredEndpoints();
}