public JsonWebTokenService(JsonWebTokenSettings jsonWebTokenSettings)
        {
            JsonWebTokenSettings = jsonWebTokenSettings;

            var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(JsonWebTokenSettings.Key));

            SigningCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha512);
        }
 public static void AddJsonWebToken(this IServiceCollection services, JsonWebTokenSettings jsonWebTokenSettings)
 {
     services.AddSingleton(_ => jsonWebTokenSettings);
     services.AddSingleton <IJsonWebTokenService, JsonWebTokenService>();
 }