public SessionInfo VerifySession(string tokenId, bool bypassCache = false)
{
try
{
if (bypassCache)
{
using (new ResponseCacheBypassScope())
{
return DoRenewSession(tokenId, true);
}
}
return DoRenewSession(tokenId, true);
}
catch (FaultException<InvalidUserSessionException> ex)
{
SessionCache.Instance.RemoveSession(tokenId);
throw new SessionValidationException(ex.Detail);
}
catch (FaultException<UserAccessDeniedException> ex)
{
SessionCache.Instance.RemoveSession(tokenId);
throw new SessionValidationException(ex.Detail);
}
catch (Exception ex)
{
//TODO: for now we can't distinguish communicate errors and credential validation errors.
// All exceptions are treated the same: we can't verify the session.
var e = new SessionValidationException(ex);
throw e;
}
}