/// <summary>
        /// Finds all  Authentication Session data with client I D containing specified keyword
        /// </summary>
        /// <param name="clientID"> Client I D</param>
        /// <returns>The result of the operation</returns>
        public OperationResult FindByClientID(string clientID)
        {
            IFindAuthenticationSessionRepository repository = (IFindAuthenticationSessionRepository)RepositoryFactory.Create(Keywords.FindAuthenticationSession);

            try
            {
                List <AuthenticationSession> res = repository.FindByClientID(clientID);
                return(new OperationResult(true, res));
            }
            catch (Exception e)
            {
                return(new OperationResult(false, e));
            }
        }
        /// <summary>
        /// Finds all  Authentication Session data with session Created Date1, session Created Date2 containing specified keyword
        /// </summary>
        /// <param name="sessionCreatedDate1"> Session Created Date</param>
        /// <param name="sessionCreatedDate2"> Session Created Date</param>
        /// <returns>The result of the operation</returns>
        public OperationResult FindBySessionCreatedDateBetween(DateTime sessionCreatedDate1, DateTime sessionCreatedDate2)
        {
            IFindAuthenticationSessionRepository repository = (IFindAuthenticationSessionRepository)RepositoryFactory.Create(Keywords.FindAuthenticationSession);

            try
            {
                List <AuthenticationSession> res = repository.FindBySessionCreatedDateBetween(sessionCreatedDate1, sessionCreatedDate2);
                return(new OperationResult(true, res));
            }
            catch (Exception e)
            {
                return(new OperationResult(false, e));
            }
        }
Exemplo n.º 3
0
        public OperationResult CheckAuthenticationSession(OAuthLoginForm loginForm)
        {
            OperationResult result = new OperationResult();
            IFindAuthenticationSessionRepository sessionRepo = (IFindAuthenticationSessionRepository)RepositoryFactory.Create("Find.Tools.OAuthServerManager.AuthenticationSession");
            List <AuthenticationSession>         sessions    = sessionRepo.FindByAuthenticationSessionString(loginForm.AuthorizationSessionID);

            if (sessions.Count > 0)
            {
                return(new OperationResult(true, sessions[0], ""));
            }
            else
            {
                return(new OperationResult(false, null));
            }
        }