Skip to content

Instantly share code, notes, and snippets.

@pcolombo
Created April 5, 2014 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pcolombo/7d7403172c28734c87e2 to your computer and use it in GitHub Desktop.
Save pcolombo/7d7403172c28734c87e2 to your computer and use it in GitHub Desktop.
Generating a LF Auth Token
public String JWToken {
get
{
var network = ConfigurationManager.AppSettings["livefyreNetwork"];
var payload = new Dictionary<string, object>()
{ { "domain", network },
{ "user_id", Info.ID },
{ "expires", DateTime.Now.AddDays(7).Ticks },
{ "display_name", Info.GetDisplayName()}
};
var secretKey = ConfigurationManager.AppSettings["livefyreNetworkSecretKey"];
return JWT.JsonWebToken.Encode(payload, secretKey, JWT.JwtHashAlgorithm.HS256);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment