Exemple #1
0
        public IAuthentication Authenticate(AuthenticationRequest request)
        {
            _log.DebugFormat("Authenticate called with: {0}", request.ToString());

            var token = SessionIdProvider.GetSessionId();

            //login here...
            //_accounts.


            //var authentication = new Authentication(0,converter.Convert<IAuthentication>(request, resultDto, token, lightstreamerConfiguration));
            //_log.DebugFormat("Login successful. Returning Authentication: {0}", authentication.ToDebugString());
            //lock (_instanceLocker)
            //{
            //    var authenticationSession = new AuthenticationSession(authentication, TimeOutProvider.Now);
            //    if (_authenticationSessionCache.ContainsKey(token))
            //    {
            //        _authenticationSessionCache[token] = authenticationSession;
            //    }
            //    else
            //    {
            //        _authenticationSessionCache.Add(token, authenticationSession);
            //    }
            //}


            //return authentication;
            return(null);
        }
        public TimeWarpAuthenticationManager(IAuthenticationSessionRepository authenticationSessionRepository, IAccountPasswordRepository accountPasswords, INowProvider nowProvider)
        {
            _accountPasswords = accountPasswords;
            _nowProvider      = nowProvider;
            _log = LogManager.GetLogger(GetType());

            _sessionIdProvider = new SessionIdProvider();
            _authenticationSessionRepository = authenticationSessionRepository;
        }
Exemple #3
0
        public void SetGetSessionId()
        {
            // Arrange
            var sut = new SessionIdProvider();

            var sessionId = Guid.NewGuid();

            // Act
            sut.SetSessionId(sessionId);
            var actual = sut.GetSessionId();

            // Assert
            Assert.Equal(sessionId, actual);
        }
Exemple #4
0
        private TimeWarpAuthenticationManager(IAccountRepository accounts)
        {
            _accounts = accounts;
            _log      = LogManager.GetLogger(GetType());
            var sessionTimeOutMinutes = ConfigurationManager.AppSettings["SessionTimeOutMinutes"];

            SessionTimeOut              = TimeSpan.FromMinutes(int.Parse(sessionTimeOutMinutes));
            TimeOutProvider             = new NowProvider();
            SessionIdProvider           = new SessionIdProvider();
            HeaderValueProvider         = new HttpContextHeaderValueProvider();
            AccountOperatorProvider     = new AccountIdsProvider();
            _authenticationSessionCache = new Dictionary <string, AuthenticationSession>();

            _log.Info("TimeWarpAuthenticationManager Instantiated");
        }
Exemple #5
0
 /// <summary>
 /// Initiates the static session collection
 /// <para xml:lang="es">Inicia la coleccion de sesión estatica.</para>
 /// </summary>
 static Session()
 {
     Sessions   = new Dictionary <string, Session>();
     IdProvider = new SessionIdProvider();
 }