Skip to main content
All docs
V25.1
  • .NET 8.0+
    • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

    SignInManager.CreateUserPrincipal(ISecurityUser, IEnumerable<Claim>) Method

    Creates a ClaimsPrincipal object for the specified user.

    Namespace: DevExpress.ExpressApp.Security

    Assembly: DevExpress.ExpressApp.Security.v25.1.dll

    NuGet Package: DevExpress.ExpressApp.Security

    Declaration

    public ClaimsPrincipal CreateUserPrincipal(
        ISecurityUser user,
        IEnumerable<Claim> additionalClaims = null
    )

    Parameters

    Name Type Description
    user ISecurityUser

    An XAF Security System user.

    Optional Parameters

    Name Type Default Description
    additionalClaims IEnumerable<Claim> null

    A list of additional claims to add to the created ClaimsPrincipal.

    Returns

    Type Description
    ClaimsPrincipal

    A ClaimsPrincipal object that is a collection of statements (claims) about the specified user within the Security System.

    Remarks

    The following code snippet demonstrates how to use the CreateUserPrincipal method:

    using DevExpress.ExpressApp.Security;
    using Microsoft.Extensions.DependencyInjection;
    // ...
    // Use Dependency Injection to access the IServiceProvider.
    var signInManager = serviceProvider.GetRequiredService<SignInManager>();
    var principal = signInManager.CreateUserPrincipal(user);
    
    See Also