public async Task <IEnumerable <ITokenMetadata> > GetAllAsync(string subject)
        {
            var result = await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync(
                async() =>
            {
                await ResilientSessionContainer.EstablishSessionAsync();
                IClientStore cs = new ClientStore();
                return(await ResilientSessionContainer.ResilientSession.FindTokenMetadataBySubject(subject, cs));
            },
                async (ex) => ResilientSessionContainer.HandleCassandraException <IEnumerable <ITokenMetadata> >(ex));

            return(result);
        }
        public async Task <RefreshToken> GetAsync(string key)
        {
            var result = await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync(
                async() =>
            {
                await ResilientSessionContainer.EstablishSessionAsync();
                IClientStore cs = new ClientStore();
                return(await ResilientSessionContainer.ResilientSession.FindRefreshTokenByKey(key, cs));
            },
                async (ex) => ResilientSessionContainer.HandleCassandraException <RefreshToken>(ex));

            return(result);
        }
Esempio n. 3
0
        public async Task <AuthorizationCode> GetAsync(string key)
        {
            var result = await TryWithAwaitInCatch.ExecuteAndHandleErrorAsync(
                async() =>
            {
                await ResilientSessionContainer.EstablishSessionAsync();
                var clientStore = new ClientStore();
                var scopeStore  = new ScopeStore();
                return
                (await
                 ResilientSessionContainer.ResilientSession.FindAuthorizationCodeByKey(key, clientStore,
                                                                                       scopeStore));
            },
                async (ex) => ResilientSessionContainer.HandleCassandraException <AuthorizationCode>(ex));

            return(result);
        }