ISecurityUserLoginInfo.ProviderUserKey Property
Returns a user’s ID according to the current provider.
Namespace: DevExpress.ExpressApp.Security
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Property Value
Type | Description |
---|---|
String | The user name. |
Remarks
For Windows Active Directory or Google, the ProviderUserKey
property value is a Windows user name or a Google account ID, respectively. This value is unique for a specific provider, but different providers can have matching keys.
The LoginProviderName and ProviderUserKey
form a unique combination. The ProviderUserKey
is not necessarily unique among all providers but is always unique for a specific provider.
To support this unique combination, XAF does the following:
- Applies the
Indexed
attribute in XPO-based applications. Specifies that
ISecurityUserLoginInfo.LoginProviderName
andISecurityUserLoginInfo.ProviderUserKey
pairs should be unique in any override of theMySolutionDbContext.OnModelCreating
method:using DevExpress.ExpressApp.Security; // ... public class MySolutionDbContext : DbContext { //... public DbSet<ApplicationUser> Users { get; set; } public DbSet<ApplicationUserLoginInfo> UserLoginInfos { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<ApplicationUserLoginInfo>(b => { b.HasIndex(nameof(ISecurityUserLoginInfo.LoginProviderName), nameof(ISecurityUserLoginInfo.ProviderUserKey)).IsUnique(); }); } }