Skip to main content
All docs
V24.2
.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.

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

UserManager.GetProviderUserKey(IPrincipal) Method

Returns the value of the User ID claim from the specified claims principal.

Namespace: DevExpress.ExpressApp.Security

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

NuGet Package: DevExpress.ExpressApp.Security

#Declaration

public string GetProviderUserKey(
    IPrincipal principal
)

#Parameters

Name Type Description
principal IPrincipal

An object that implements the IPrincipal interface.

#Returns

Type Description
String

A System.String value that contains the user key.

#Remarks

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

using DevExpress.ExpressApp.Security;
using Microsoft.Extensions.DependencyInjection;
// ...
// Use Dependency Injection to access the IServiceProvider.
var userManager = serviceProvider.GetRequiredService<UserManager>();
string userKey = userManager.GetProviderUserKey(principal);
See Also