Example #1
0
        protected void CheckIfSessionIsStillValid()
        {
            _session = UserAuthentication.ValidateSession(_session.Principal.Identity.Name, _session.SessionToken.Id);
            _lastSessionCheckTicks = Environment.TickCount;

            if (Platform.IsLogLevelEnabled(LogLevel.Debug))
            {
                Platform.Log(LogLevel.Debug, "Session {0} for user {1} is still valid. Will expire on {2}", _session.SessionToken.Id, _session.Principal.Identity.Name, _session.SessionToken.ExpiryTime);
            }
        }
Example #2
0
        private void AuthenticateUser(StartApplicationRequest request)
        {
            _userName = request.Username;
            if (!String.IsNullOrEmpty(request.SessionId))
            {
                IsSessionShared = request.IsSessionShared;
            }

            _session = UserAuthentication.ValidateSession(request.Username, request.SessionId);
            if (_session == null)
            {
                return;
            }

            if (_session.Principal != null)
            {
                Thread.CurrentPrincipal = Principal = _session.Principal;
            }
        }