Skip to content

Instantly share code, notes, and snippets.

@jazlalli
Last active December 11, 2015 12:58
Show Gist options
  • Save jazlalli/4604269 to your computer and use it in GitHub Desktop.
Save jazlalli/4604269 to your computer and use it in GitHub Desktop.
JWT claimset
// jwt claimset
var issueTime = _dateTimeConverter.ToUnixTimeStamp(date);
var expiryTime = _dateTimeConverter.ToUnixTimeStamp(date.AddMinutes(60));
var claim = new
{
iss = serviceAccountEmail,
scope = "https://www.googleapis.com/auth/bigquery",
aud = "https://accounts.google.com/o/oauth2/token",
iat = issueTime,
exp = expiryTime,
};
//encoding
var claimBytes = Encoding.UTF8.GetBytes(_jsonProvider.Serialize(claim));
var claimEncoded = _base64Encoder.ToBase64UrlEncodedString(claimBytes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment