ISecurityUserWithLoginInfo.CreateUserLoginInfo(String, String) Method
Allows the XAF framework to create a UserLoginInfo instance.
Namespace: DevExpress.ExpressApp.Security
Assembly: DevExpress.ExpressApp.v25.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
ISecurityUserLoginInfo CreateUserLoginInfo(
string loginProviderName,
string providerUserKey
)
Parameters
| Name | Type | Description |
|---|---|---|
| loginProviderName | String | The authentication type name. |
| providerUserKey | String | The user ID. |
Returns
| Type | Description |
|---|---|
| ISecurityUserLoginInfo | Login information. |
Remarks
The following example uses the ISecurityUserWithLoginInfo interface to store user authentication methods:
using System.Collections.ObjectModel;
using System.ComponentModel;
using DevExpress.ExpressApp.Security;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl.EF;
using DevExpress.Persistent.BaseImpl.EF.PermissionPolicy;
namespace MainDemo.Module.BusinessObjects;
[CurrentUserDisplayImage(nameof(Photo))]
[DefaultProperty(nameof(UserName))]
public class ApplicationUser : PermissionPolicyUser, ISecurityUserWithLoginInfo {
public ApplicationUser() { }
[Browsable(false)]
[DevExpress.ExpressApp.DC.Aggregated]
public virtual IList<ApplicationUserLoginInfo> UserLogins { get; set; } = new ObservableCollection<ApplicationUserLoginInfo>();
IEnumerable<ISecurityUserLoginInfo> IOAuthSecurityUser.UserLogins => UserLogins;
[HideInUI(HideInUI.ListViewColumn)]
[ImageEditor(ListViewImageEditorCustomHeight = 75, DetailViewImageEditorFixedHeight = 150)]
public virtual MediaDataObject Photo { get; set; }
ISecurityUserLoginInfo ISecurityUserWithLoginInfo.CreateUserLoginInfo(string loginProviderName, string providerUserKey) {
ApplicationUserLoginInfo result = ObjectSpace.CreateObject<ApplicationUserLoginInfo>();
result.LoginProviderName = loginProviderName;
result.ProviderUserKey = providerUserKey;
result.User = this;
return result;
}
public override void OnCreated() {
Photo = ObjectSpace.CreateObject<MediaDataObject>();
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CreateUserLoginInfo(String, String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.