I wanted to let you know that embedding the resources in the project file has solved the issue. Thanks so much for your time and assistance in troubleshooting this—it’s greatly appreciated!
Thank you 🙏
Hi
Just following up on this ticket.
Thanks
Hi, I will test it and try to write you back asap.
Hi, we are currently testing according to your steps and let you know asap.
Best regards.
Hi, this is the expected behavior (https://abp.io/docs/latest/modules/account-pro#social-account-security-setting):
Users who register via both local registration and external/social login using the same email address will be required to enter their local password on the first external/social login.
You can disable this option if you want.
Hi, you need to create a custom event handler for that purpose. Please apply the following steps:
using System.Threading.Tasks;
using OpenIddict.Server;
namespace MySolution;
public class SignOutEventHandler : IOpenIddictServerHandler<OpenIddictServerEvents.ProcessSignOutContext>
{
public static OpenIddictServerHandlerDescriptor Descriptor { get; }
= OpenIddictServerHandlerDescriptor.CreateBuilder<OpenIddictServerEvents.ProcessSignOutContext>()
.UseSingletonHandler<SignOutEventHandler>()
.SetOrder(100_000)
.SetType(OpenIddictServerHandlerType.Custom)
.Build();
public ValueTask HandleAsync(OpenIddictServerEvents.ProcessSignOutContext context)
{
//your logic...
return ValueTask.CompletedTask;
}
}
public class MySolutionHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
//...
PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
{
serverBuilder.AddEventHandler(SignOutEventHandler.Descriptor);
});
//...
}
}
SignOutEventHandler
class's HandleAsync method trigger after every signout request.Hi again, I have checked your project and found the problem. Everything you did was correct and necessary, however, it seems you missed setting the related localization files as EmbeddedResource. This is required for the production environment.
You should add the following lines to the *.Domain.Shared.csproj
file, and then it should work as expected:
<ItemGroup>
<EmbeddedResource Include="Localization\ManasotaErp\*.json" />
<Content Remove="Localization\ManasotaErp\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\AbpIdentity\*.json" />
<Content Remove="Localization\AbpAccount\*.json" />
</ItemGroup>
Best regards.
Update: I got your project and checking currently. I will write you back asap.
Thanks, the issue is resolved. So, for each module, if I want to use FullAuditedEntityWithUser or establish a relationship with IdentityUser, I need to follow the same steps, correct?
Yes, that's right 👍Because, you need to have the relationship for the IdentityUser
entity.
I'm closing the question since your problem is resolved. Best regards.
Hi, I will create an internal issue for your feature request. Thanks for your suggestion.
Regards.
Hi, I checked your project and found the problem. In your shared.entityframeworkcore project, you should call the builder.ConfigureIdentityPro()
before your entity configuration. Because you are using the FullAuditedEntityWithUser
in the UserNotification entity.
Here is what you should do:
<PackageReference Include="Volo.Abp.Identity.Pro.EntityFrameworkCore" Version="9.0.4" />
to Shared.EntityFrameworkCore.csproj.typeof(AbpIdentityProEntityFrameworkCoreModule)
this depends on statement to SharedEntityFrameworkCoreModule
class.SharedDbContext
class, and update it as follows (don't forget to add builder.ConfigureIdentityPro()
):using Microsoft.EntityFrameworkCore;
using Shared.EntityFrameworkCore.Configurations;
using Shared.Notifications;
using Shared.NotificationTemplates;
using Shared.UserDevices;
using Shared.UserNotifications;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
namespace Shared.EntityFrameworkCore;
[ReplaceDbContext(typeof(IIdentityProDbContext))]
[ConnectionStringName(SharedDbProperties.ConnectionStringName)]
public class SharedDbContext : AbpDbContext<SharedDbContext>, ISharedDbContext, IIdentityProDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
public DbSet<UserNotification> UserNotifications { get; set; }
public DbSet<Notification> Notifications { get; set; }
public DbSet<NotificationTemplate> NotificationTemplates { get; set; }
public DbSet<UserDevice> UserDevices { get; set; }
public SharedDbContext(DbContextOptions<SharedDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureIdentityPro();
builder.ConfigureShared();
}
//Identity
public DbSet<IdentityUser> Users { get; }
public DbSet<IdentityRole> Roles { get; }
public DbSet<IdentityClaimType> ClaimTypes { get; }
public DbSet<OrganizationUnit> OrganizationUnits { get; }
public DbSet<IdentitySecurityLog> SecurityLogs { get; }
public DbSet<IdentityLinkUser> LinkUsers { get; }
public DbSet<IdentityUserDelegation> UserDelegations { get; }
public DbSet<IdentitySession> Sessions { get; }
}
Then, run the dbmigrator without having a problem.