예제 #1
0
        public bool VerifyUserToken(JwtToken userRequestToken)
        {
            var now = DateTime.UtcNow;
            var unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
            var padding = new TimeSpan(0, 5, 0);
            var validFrom = unixEpoch.AddSeconds(int.Parse(userRequestToken.nbf));
            var validTo = unixEpoch.AddSeconds(int.Parse(userRequestToken.exp));

            return userRequestToken.aud == _appConfig.ClientId &&
                   now > (validFrom - padding)&&
                   now < (validTo + padding);
        }
예제 #2
0
 public bool ValidateAppOnlyToken(JwtToken openIdToken)
 {
     return true;
 }
예제 #3
0
 public void SetAndSaveTenantId(JwtToken openIdToken, ref string tenantId)
 {
     tenantId = openIdToken.tid;
     Blob.UploadText(tenantId);
 }