23 lines
1019 B
C#
23 lines
1019 B
C#
// Copyright (c) .NET Foundation. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
using System.Security.Claims;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Microsoft.AspNetCore.Identity
|
|
{
|
|
/// <summary>
|
|
/// Provides an abstraction for a factory to create a <see cref="ClaimsPrincipal"/> from a user.
|
|
/// </summary>
|
|
/// <typeparam name="TUser">The type encapsulating a user.</typeparam>
|
|
public interface IUserClaimsPrincipalFactory<TUser>
|
|
where TUser : class
|
|
{
|
|
/// <summary>
|
|
/// Creates a <see cref="ClaimsPrincipal"/> from an user asynchronously.
|
|
/// </summary>
|
|
/// <param name="user">The user to create a <see cref="ClaimsPrincipal"/> from.</param>
|
|
/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns>
|
|
Task<ClaimsPrincipal> CreateAsync(TUser user);
|
|
}
|
|
} |