if (i != m_listenerMap.end())
ret = i->second;
m_listenerMap[address] = listener;
- Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").info("registered remoted message endpoint (%s)",address);
+ Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").info("registered remoted message endpoint (%s)",address);
return ret;
}
m_listenerMap[address] = restore;
else
m_listenerMap.erase(address);
- Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").info("unregistered remoted message endpoint (%s)",address);
+ Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").info("unregistered remoted message endpoint (%s)",address);
return true;
}
return false;
#ifdef _DEBUG
xmltooling::NDC ndc("doAuthentication");
#endif
- Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
+ Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
const Application* app = nullptr;
string targetURL = request.getRequestURL();
Session* session = nullptr;
try {
- session = request.getSession();
+ session = request.getSession(true, false, false); // don't cache it
}
catch (exception& e) {
log.warn("error during session lookup: %s", e.what());
throw;
}
+ Locker slocker(session, false); // pop existing lock on exit
if (session) {
// Check for logout interception.
if (requireLogoutWith.first) {
if (!qstr || !strstr(qstr, "shiblogoutdone=1")) {
// First leg of circuit, so we redirect to the logout endpoint specified with this URL as a return location.
string selfurl = request.getRequestURL();
- if (!qstr)
+ if (qstr)
+ selfurl += '&';
+ else
selfurl += '?';
selfurl += "shiblogoutdone=1";
string loc = requireLogoutWith.second;
throw ConfigurationException("No default session initiator found, check configuration.");
}
- return initiator->run(request, false);
+ // Dispatch to SessionInitiator. This MUST handle the request, or we want to fail here.
+ // Used to fall through into doExport, but this is a cleaner exit path.
+ pair<bool,long> ret = initiator->run(request, false);
+ if (ret.first)
+ return ret;
+ throw ConfigurationException("Session initiator did not handle request for a new session, check configuration.");
}
request.setAuthType(authType.second);
#ifdef _DEBUG
xmltooling::NDC ndc("doAuthorization");
#endif
- Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
+ Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
const Application* app = nullptr;
- const Session* session = nullptr;
+ Session* session = nullptr;
+ Locker slocker;
string targetURL = request.getRequestURL();
try {
// Do we have an access control plugin?
if (settings.second) {
try {
- session = request.getSession(false);
+ session = request.getSession(false, false, false); // ignore timeout and do not cache
+ if (session)
+ slocker.assign(session, false); // assign to lock popper
}
catch (exception& e) {
log.warn("unable to obtain session to pass to access control provider: %s", e.what());
#ifdef _DEBUG
xmltooling::NDC ndc("doExport");
#endif
- Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
+ Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
const Application* app = nullptr;
- const Session* session = nullptr;
+ Session* session = nullptr;
+ Locker slocker;
string targetURL = request.getRequestURL();
try {
app = &(request.getApplication());
try {
- session = request.getSession(false);
+ session = request.getSession(false, false, false); // ignore timeout and do not cache
+ if (session)
+ slocker.assign(session, false); // assign to lock popper
}
catch (exception& e) {
log.warn("unable to obtain session to export to request: %s", e.what());
#ifdef _DEBUG
xmltooling::NDC ndc("doHandler");
#endif
- Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
+ Category& log = Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider");
const Application* app = nullptr;
string targetURL = request.getRequestURL();
}
catch (exception& e) {
request.log(SPRequest::SPError, e.what());
- const Session* session = nullptr;
+ Session* session = nullptr;
try {
- session = request.getSession(false, true);
+ session = request.getSession(false, true, false); // do not cache
}
catch (exception&) {
}
+ Locker slocker(session, false); // pop existing lock on exit
TemplateParameters tp(&e, nullptr, session);
tp.m_map["requestURL"] = targetURL.substr(0, targetURL.find('?'));
tp.m_request = &request;