public static RebateArg FromRebateAppToken(this RebateAppToken apptoken, Func <string, string> GetSecret) { var secret = GetSecret(apptoken.AppName); if (secret.IsNullOrEmpty()) { return(default);
public static RebateAppToken ToRebateAppToken(this RebateArg arg, string secret) { List <Claim> list = new List <Claim>(); Claim orderid = new Claim(RebateArg.RebateClaimType, arg.BillJson); list.Add(orderid); DefaultJwtPrincipalBuilder jwtBuilder = new DefaultJwtPrincipalBuilder(secret); var token = jwtBuilder.BuildToken(list); RebateAppToken pac = new RebateAppToken() { Token = token, AppName = arg.AppName }; return(pac); }