Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
private string GetJwtTokenProof(X509Certificate2 signingCert, string appId)
var notBefore = DateTime.Now;
var expires = notBefore.AddMinutes(10);
var handler = new JwtSecurityTokenHandler();
var credentials = new X509SigningCredentials(signingCert);
var jwtToken = handler.CreateJwtSecurityToken(appId, "", null, notBefore, expires, null, credentials);
return handler.WriteToken(jwtToken);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment