using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Utils.Jwt { /// /// token工具类的接口,方便使用依赖注入 /// public interface ITokenHelper { /// /// 根据一个对象通过反射提供负载生成token /// /// /// /// TnToken CreateToken(T user) where T : class; /// /// 根据键值对提供负载生成token /// /// /// TnToken CreateToken(Dictionary keyValuePairs); /// /// Token验证 /// /// token /// 自定义各类验证; 是否包含那种申明,或者申明的值 /// bool ValiToken(string encodeJwt, Func, bool> validatePayLoad = null); /// /// 带返回状态的Token验证 /// /// token /// 自定义各类验证; 是否包含那种申明,或者申明的值 /// /// TokenType ValiTokenState(string encodeJwt, Func, bool> validatePayLoad, Action> action); } }