-
-
Save pcolombo/7d7403172c28734c87e2 to your computer and use it in GitHub Desktop.
Generating a LF Auth Token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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