Renew() private method

private Renew ( string tokenId, bool bypassCache = false ) : ClearCanvas.Web.Enterprise.Authentication.SessionInfo
tokenId string
bypassCache bool
return ClearCanvas.Web.Enterprise.Authentication.SessionInfo
Ejemplo n.º 1
0
 public UserSessionInfo RenewSession(UserSessionInfo session)
 {
     using (LoginService service = new LoginService())
     {
         var newToken = service.Renew(session.SessionToken.Id);
         return new UserSessionInfo(session.Principal, newToken);
     }
 }
Ejemplo n.º 2
0
        public void Validate()
        {
            _valid = false;

            using (var service = new LoginService())
            {
                SessionInfo sessionInfo = service.Query(Credentials.SessionToken.Id);

                if (sessionInfo == null)
                {
                    throw new SessionValidationException();
                }

                _user.Credentials = sessionInfo.Credentials;
                SessionToken newToken = service.Renew(Credentials.SessionToken.Id);
                _user.Credentials.SessionToken = newToken;
                _valid = true;
            }
        }
Ejemplo n.º 3
0
        public void Validate()
        {
            _valid = false;

            using (var service = new LoginService())
            {
                try
                {
                    var sessionInfo = service.Renew(Credentials.SessionToken.Id);
                    _user.Credentials.SessionToken = sessionInfo.Credentials.SessionToken;
                    _user.Credentials.Authorities  = sessionInfo.Credentials.Authorities;
                    _user.Credentials.DataAccessAuthorityGroups = sessionInfo.Credentials.DataAccessAuthorityGroups;

                    _valid = true;
                }
                catch (Exception)
                {
                    throw new SessionValidationException();
                }
            }
        }
Ejemplo n.º 4
0
		/// <summary>
		/// Renew the current session
		/// </summary>
		public static void RenewSession()
		{
			var session = Current;

			if (session != null)
			{
				using (var service = new LoginService())
				{
					SessionInfo sessionInfo = service.Renew(session.Credentials.SessionToken.Id, true /* force to bypass local cache */);
					InitializeSession(sessionInfo);
				}
			}
			
		}
Ejemplo n.º 5
0
        public void Validate()
        {
            _valid = false;

            using(var service = new LoginService())
            {
                SessionInfo sessionInfo = service.Query(Credentials.SessionToken.Id);

                if (sessionInfo == null)
                {
                    throw new SessionValidationException();
                }

                _user.Credentials = sessionInfo.Credentials;
                SessionToken newToken = service.Renew(Credentials.SessionToken.Id);
                _user.Credentials.SessionToken = newToken;
                _valid = true;
            }   
        }
Ejemplo n.º 6
0
        public void Validate()
        {
            _valid = false;

            using(var service = new LoginService())
            {
                try
                {
                    var sessionInfo = service.Renew(Credentials.SessionToken.Id);
                    _user.Credentials.SessionToken = sessionInfo.Credentials.SessionToken;
                    _user.Credentials.Authorities = sessionInfo.Credentials.Authorities;
                    _user.Credentials.DataAccessAuthorityGroups = sessionInfo.Credentials.DataAccessAuthorityGroups;

                    _valid = true;
                }
                catch (Exception)
                {
                    throw new SessionValidationException();
                }
            }   
        }