Last active
December 11, 2015 12:58
-
-
Save jazlalli/4604269 to your computer and use it in GitHub Desktop.
JWT claimset
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
// 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