// TEST the session...
try {
+ // Grab the origin
+ const XMLCh* origin = entry->getStatement()->getSubject()->getNameQualifier();
+
// Verify the address is the same
if (argp->checkIPAddress) {
log.debug ("Checking address against %s", entry->getClientAddress());
log.debug ("IP Address mismatch");
throw ShibTargetException(SHIBRPC_IPADDR_MISMATCH,
- "Your IP address does not match the address in the original authentication.");
+ "Your IP address does not match the address in the original authentication.",
+ origin);
}
}
if (!entry->isSessionValid(argp->lifetime, argp->timeout)) {
log.debug ("Session expired");
throw ShibTargetException(SHIBRPC_SESSION_EXPIRED,
- "Your session has expired. Re-authenticate.");
+ "Your session has expired. Re-authenticate.",
+ origin);
}
// and now try to prefetch the attributes .. this could cause an
log.debug ("prefetch failed with a SAML Exception: %s", e.what());
ostringstream os;
os << e;
- throw ShibTargetException(SHIBRPC_SAML_EXCEPTION, os.str());
+ throw ShibTargetException(SHIBRPC_SAML_EXCEPTION, os.str(), origin);
} catch (...) {
log.error ("prefetch caught an unknown exception");
throw ShibTargetException(SHIBRPC_UNKNOWN_ERROR,
- "An unknown error occured while pre-fetching attributes.");
+ "An unknown error occured while pre-fetching attributes.",
+ origin);
}
} catch (ShibTargetException &e) {
return TRUE;
}
+ // Grab the origin
+ const XMLCh* origin = entry->getStatement()->getSubject()->getNameQualifier();
+
// Validate the client address (again?)
if (argp->checkIPAddress &&
strcmp (argp->cookie.client_addr, entry->getClientAddress())) {
log.error ("IP Mismatch");
- set_rpc_status(&result->status, SHIBRPC_IPADDR_MISMATCH,
- "Your IP address does not match the address in the original authentication.", "");
+ set_rpc_status_x(&result->status, SHIBRPC_IPADDR_MISMATCH,
+ "Your IP address does not match the address in the original authentication.",
+ origin);
entry->release();
return TRUE;
}
log.error ("received SAML exception: %s", e.what());
ostringstream os;
os << e;
- set_rpc_status(&result->status, SHIBRPC_SAML_EXCEPTION,
- strdup(os.str().c_str()), "");
+ set_rpc_status_x(&result->status, SHIBRPC_SAML_EXCEPTION,
+ strdup(os.str().c_str()), origin);
entry->release();
return TRUE;
}