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

SignInManager.CreateUserPrincipal(String) Method

Creates a ClaimsPrincipal object based on a user’s authentication token.

Namespace: DevExpress.ExpressApp.Security

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

NuGet Package: DevExpress.ExpressApp.Security

Declaration

public AuthenticationResult CreateUserPrincipal(
    string userToken
)

Parameters

Name Type Description
userToken String

A string value that contains a user login token.

Returns

Type Description
DevExpress.ExpressApp.Security.AuthenticationResult

An object of the AuthenticationResult type that contains the result.

Remarks

Important

This overload of the CreateUserPrincipal method is not supported on the WinForms platform. If called from a WinForms application, it throws the PlatformNotSupportedException.

Use this method overload to create a ClaimsPrincipal object for a user based on the user’s login token. It returns an AuthenticationResult object that exposes the following properties:

Succeeded
A boolean property that indicates whether or not the user was successfully resolved based on the token.
Principal
If the operation succeeds, this property contains the ClaimsPrincipal object (a collection of statements about the authenticated user) returned by the Security System.
Error
If the operation fails, this property contains the resulting Exception.

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(userAuthenticationToken);
See Also