// SAML Runtime
#include <saml/saml.h>
#include <shib/shib.h>
-#include <shib/shib-threads.h>
#include <shib-target/shib-target.h>
+#include <shibsp/SPConfig.h>
#include <xercesc/util/regx/RegularExpression.hpp>
#ifdef WIN32
#include <unistd.h> // for getpid()
#endif
-using namespace std;
-using namespace saml;
-using namespace shibboleth;
+using namespace shibsp;
using namespace shibtarget;
+using namespace saml;
+using namespace xmltooling;
+using namespace std;
extern "C" module MODULE_VAR_EXPORT mod_shib;
char* g_szSHIBConfig = NULL;
char* g_szSchemaDir = NULL;
ShibTargetConfig* g_Config = NULL;
+ string g_unsetHeaderValue;
static const char* g_UserDataKey = "_shib_check_user_";
}
}
virtual void clearHeader(const string &name) {
ap_table_unset(m_req->headers_in, name.c_str());
+ ap_table_set(m_req->headers_in, name.c_str(), g_unsetHeaderValue.c_str());
}
virtual void setHeader(const string &name, const string &value) {
ap_table_set(m_req->headers_in, name.c_str(), value.c_str());
}
}
else {
- Iterator<IAAP*> provs=st->getApplication()->getAAPProviders();
- AAP wrapper(provs,w);
+ Iterator<shibboleth::IAAP*> provs=st->getApplication()->getAAPProviders();
+ shibboleth::AAP wrapper(provs,w);
if (wrapper.fail()) {
st->log(ShibTarget::LogLevelWarn, string("htAccessControl plugin didn't recognize require rule: ") + w);
continue;
try {
g_Config=&ShibTargetConfig::getConfig();
- g_Config->setFeatures(
- ShibTargetConfig::Caching |
- ShibTargetConfig::Listener |
- ShibTargetConfig::Metadata |
- ShibTargetConfig::AAP |
- ShibTargetConfig::RequestMapper |
- ShibTargetConfig::InProcess |
- ShibTargetConfig::Logging
+ SPConfig::getConfig().setFeatures(
+ SPConfig::Caching |
+ SPConfig::Listener |
+ SPConfig::Metadata |
+ SPConfig::AAP |
+ SPConfig::RequestMapper |
+ SPConfig::InProcess |
+ SPConfig::Logging
);
if (!g_Config->init(g_szSchemaDir)) {
ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to initialize libraries");
ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to load configuration");
exit(1);
}
+
+ IConfig* conf=g_Config->getINI();
+ Locker locker(conf);
+ const IPropertySet* props=conf->getPropertySet("Local");
+ if (props) {
+ pair<bool,const char*> unsetValue=props->getString("unsetHeaderValue");
+ if (unsetValue.first)
+ g_unsetHeaderValue = unsetValue.second;
+ }
}
catch (...) {
ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),"shib_child_init() failed to initialize system");
NULL /* post read-request */
};
-#elif defined(SHIB_APACHE_20)
+#elif defined(SHIB_APACHE_20) || defined(SHIB_APACHE_22)
extern "C" void shib_register_hooks (apr_pool_t *p)
{