Beispiel #1
0
        public async Task <bool> CreateAuthorizationCodeHandleAsync(string key, global::IdentityServer3.Core.Models.AuthorizationCode value,
                                                                    CancellationToken cancellationToken = default(CancellationToken))
        {
            var fRecord = new FlattenedAuthorizationCodeHandle(key, value);

            return(await CreateAuthorizationCodeHandleAsync(fRecord));
        }
Beispiel #2
0
 public async Task StoreAsync(string key, global::IdentityServer3.Core.Models.AuthorizationCode value)
 {
     await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync(
         async() =>
     {
         await ResilientSessionContainer.EstablishSessionAsync();
         await ResilientSessionContainer.ResilientSession.CreateAuthorizationCodeHandleAsync(key, value);
     },
         async (ex) => ResilientSessionContainer.HandleCassandraException <Task>(ex));
 }
 /*
  *   doc["_id"] = key;
  *  doc["_version"] = 1;
  *  doc["_clientId"] = code.ClientId;
  *  doc["_subjectId"] = code.SubjectId;
  *  doc["_expires"] = code.CreationTime.AddSeconds(code.Client.AuthorizationCodeLifetime).ToBsonDateTime();
  *  doc["creationTime"] = code.CreationTime.ToBsonDateTime();
  *  doc["isOpenId"] = code.IsOpenId;
  *  doc["redirectUri"] = code.RedirectUri;
  *  doc["wasConsentShown"] = code.WasConsentShown;
  *  doc.SetIfNotNull("nonce", code.Nonce);
  *  doc["subject"] = SerializeIdentities(code);
  */
 public AuthorizationCodeHandle(string key, global::IdentityServer3.Core.Models.AuthorizationCode code)
 {
     Key = key;
     if (code != null)
     {
         ClientId             = code.ClientId;
         SubjectId            = code.SubjectId;
         Expires              = code.CreationTime.AddSeconds(code.Client.AuthorizationCodeLifetime);
         CreationTime         = code.CreationTime;
         IsOpenId             = code.IsOpenId;
         RedirectUri          = code.RedirectUri;
         WasConsentShown      = code.WasConsentShown;
         Nonce                = code.Nonce;
         ClaimIdentityRecords = code.Subject.Identities.ToList().ToClaimIdentityRecords();
         var query = from item in code.RequestedScopes
                     select new ScopeHandle(item);
         RequestedScopes = query.ToNames();
     }
 }
Beispiel #4
0
 public AuthorizationCodeHandle(string key, global::IdentityServer3.Core.Models.AuthorizationCode code)
     : base(key, code)
 {
 }