public JwtSecurityToken BuildToken(ClaimsIdentity identity)
        {
            var expires = _systemClock.UtcNow.UtcDateTime + _options.Value.TokenLifetime;

            AuthenticationLogMessages.AuthenticationTokenBuilding(_logger, identity, expires);
            var descriptor = new SecurityTokenDescriptor()
            {
                Subject            = identity,
                SigningCredentials = _signingCredentials,
                Expires            = expires
            };

            var token = _tokenHandler.CreateJwtSecurityToken(descriptor);

            AuthenticationLogMessages.AuthenticationTokenBuilt(_logger, token);

            return(token);
        }