public static LinkArg FromLinkAppToken(this LinkAppToken apptoken, Func <string, string> GetSecret) { var secret = GetSecret(apptoken.AppName); if (secret.IsNullOrEmpty()) { return(default);
public static LinkAppToken ToLinkAppToken(this LinkArg arg, string secret) { List <Claim> list = new List <Claim>(); Claim orderid = new Claim(LinkArg.LinkClaimType, arg.BillJson); list.Add(orderid); DefaultJwtPrincipalBuilder jwtBuilder = new DefaultJwtPrincipalBuilder(secret); var token = jwtBuilder.BuildToken(list); LinkAppToken pac = new LinkAppToken() { Token = token, AppName = arg.AppName }; return(pac); }