// 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; using System.Security.Claims; using System.Threading.Tasks; namespace Microsoft.AspNetCore.Authentication { public class ClaimsTransformer : IClaimsTransformer { public Func> OnTransform { get; set; } public virtual Task TransformAsync(ClaimsTransformationContext context) { return OnTransform?.Invoke(context) ?? Task.FromResult(context.Principal); } } }