Exemple #1
0
        private ClaimsIdentity GetClaimsIdentity(Identity identity)
        {
            ClaimsBuilder claimsBuilder = ClaimsBuilder.CreateBuilder();

            foreach (Claim identityClaim in identity.Claims)
            {
                claimsBuilder.AddClaim(identityClaim.Type, identityClaim.Value);
            }

            claimsBuilder.WithSubject(identity.Id);

            claimsBuilder.WithRole(identity.IsConfirmed ? JwtClaims.AppAccess : JwtClaims.RestrictedAppAccess);

            ClaimsIdentity claimsIdentity = claimsBuilder.Build();

            return(claimsIdentity);
        }