#ifndef SHIBSP_LITE
scoped_ptr<TransactionLog> m_tranLog;
scoped_ptr<SecurityPolicyProvider> m_policy;
- vector< tuple<string,string,string> > m_transportOptions;
+ vector< boost::tuple<string,string,string> > m_transportOptions;
#endif
scoped_ptr<RequestMapper> m_requestMapper;
map< string,boost::shared_ptr<Application> > m_appmap;
#endif
{
public:
- XMLConfig(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".Config")) {}
+ XMLConfig(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT ".Config")) {}
void init() {
background_load();
bool setTransportOptions(SOAPTransport& transport) const {
bool ret = true;
- for (vector< tuple<string,string,string> >::const_iterator opt = m_impl->m_transportOptions.begin();
+ for (vector< boost::tuple<string,string,string> >::const_iterator opt = m_impl->m_transportOptions.begin();
opt != m_impl->m_transportOptions.end(); ++opt) {
if (!transport.setProviderOption(opt->get<0>().c_str(), opt->get<1>().c_str(), opt->get<2>().c_str())) {
m_log.error("failed to set SOAPTransport option (%s)", opt->get<1>().c_str());
#ifdef _DEBUG
xmltooling::NDC ndc("XMLApplication");
#endif
- Category& log = Category::getInstance(SHIBSP_LOGCAT".Application");
+ Category& log = Category::getInstance(SHIBSP_LOGCAT ".Application");
// First load any property sets.
map<string,string> remapper;
prop = sessionProps->getString("redirectWhitelist");
if (prop.first) {
string dup(prop.second);
+ trim(dup);
split(m_redirectWhitelist, dup, is_space(), algorithm::token_compress_on);
}
}
pair<bool,const char*> attributes = getString("REMOTE_USER");
if (attributes.first) {
string dup(attributes.second);
+ trim(dup);
split(m_remoteUsers, dup, is_space(), algorithm::token_compress_on);
}
}
string dup(attributes.second);
+ trim(dup);
vector<string> headerNames;
split(headerNames, dup, is_space(), algorithm::token_compress_on);
for (vector<string>::const_iterator h = headerNames.begin(); h != headerNames.end(); ++h) {
{
if (!e->hasChildNodes())
return;
+ DOMNamedNodeMap* ssoprops = e->getAttributes();
+ XMLSize_t ssopropslen = ssoprops ? ssoprops->getLength() : 0;
SPConfig& conf = SPConfig::getConfig();
pathprop = (*b)->getXMLString("path");
if (idprop.first && pathprop.first) {
DOMElement* acsdom = e->getOwnerDocument()->createElementNS(samlconstants::SAML20MD_NS, _AssertionConsumerService);
+
+ // Copy in any attributes from the <SSO> element so they can be accessed as properties in the ACS handler.
+ for (XMLSize_t p = 0; p < ssopropslen; ++p) {
+ DOMNode* ssoprop = ssoprops->item(p);
+ if (ssoprop->getNodeType() == DOMNode::ATTRIBUTE_NODE) {
+ acsdom->setAttributeNS(
+ ((DOMAttr*)ssoprop)->getNamespaceURI(),
+ ((DOMAttr*)ssoprop)->getLocalName(),
+ ((DOMAttr*)ssoprop)->getValue()
+ );
+ }
+ }
+
+ // Set necessary properties based on context.
acsdom->setAttributeNS(nullptr, Binding, idprop.second);
acsdom->setAttributeNS(nullptr, Location, pathprop.second);
xstring indexbuf(1, chDigit_1 + (index % 10));
if (index / 10)
indexbuf = (XMLCh)(chDigit_1 + (index / 10)) + indexbuf;
acsdom->setAttributeNS(nullptr, _index, indexbuf.c_str());
- if (e->hasAttributeNS(nullptr, _policyId))
- acsdom->setAttributeNS(shibspconstants::SHIB2SPCONFIG_NS, _policyId, e->getAttributeNS(nullptr, _policyId));
log.info("adding AssertionConsumerService for Binding (%s) at (%s)", (*b)->getString("id").second, (*b)->getString("path").second);
boost::shared_ptr<Handler> handler(
{
if (!e->hasChildNodes())
return;
+ DOMNamedNodeMap* sloprops = e->getAttributes();
+ XMLSize_t slopropslen = sloprops ? sloprops->getLength() : 0;
SPConfig& conf = SPConfig::getConfig();
pathprop = (*b)->getXMLString("path");
if (idprop.first && pathprop.first) {
DOMElement* slodom = e->getOwnerDocument()->createElementNS(samlconstants::SAML20MD_NS, _SingleLogoutService);
+
+ // Copy in any attributes from the <Logout> element so they can be accessed as properties in the SLO handler.
+ for (XMLSize_t p = 0; p < slopropslen; ++p) {
+ DOMNode* sloprop = sloprops->item(p);
+ if (sloprop->getNodeType() == DOMNode::ATTRIBUTE_NODE) {
+ slodom->setAttributeNS(
+ ((DOMAttr*)sloprop)->getNamespaceURI(),
+ ((DOMAttr*)sloprop)->getLocalName(),
+ ((DOMAttr*)sloprop)->getValue()
+ );
+ }
+ }
+
+ // Set necessary properties based on context.
slodom->setAttributeNS(nullptr, Binding, idprop.second);
slodom->setAttributeNS(nullptr, Location, pathprop.second);
if (e->hasAttributeNS(nullptr, _policyId))
{
if (!e->hasChildNodes())
return;
+ DOMNamedNodeMap* nimprops = e->getAttributes();
+ XMLSize_t nimpropslen = nimprops ? nimprops->getLength() : 0;
SPConfig& conf = SPConfig::getConfig();
pathprop = (*b)->getXMLString("path");
if (idprop.first && pathprop.first) {
DOMElement* nimdom = e->getOwnerDocument()->createElementNS(samlconstants::SAML20MD_NS, _ManageNameIDService);
+
+ // Copy in any attributes from the <NameIDMgmt> element so they can be accessed as properties in the NIM handler.
+ for (XMLSize_t p = 0; p < nimpropslen; ++p) {
+ DOMNode* nimprop = nimprops->item(p);
+ if (nimprop->getNodeType() == DOMNode::ATTRIBUTE_NODE) {
+ nimdom->setAttributeNS(
+ ((DOMAttr*)nimprop)->getNamespaceURI(),
+ ((DOMAttr*)nimprop)->getLocalName(),
+ ((DOMAttr*)nimprop)->getValue()
+ );
+ }
+ }
+
+ // Set necessary properties based on context.
nimdom->setAttributeNS(nullptr, Binding, idprop.second);
nimdom->setAttributeNS(nullptr, Location, pathprop.second);
if (e->hasAttributeNS(nullptr, _policyId))
boost::bind(startsWithI, url, boost::bind(&string::c_str, _1))) != m_redirectWhitelist.end()) {
return;
}
- Category::getInstance(SHIBSP_LOGCAT".Application").warn("redirectLimit policy enforced, blocked redirect to (%s)", url);
+ Category::getInstance(SHIBSP_LOGCAT ".Application").warn("redirectLimit policy enforced, blocked redirect to (%s)", url);
throw opensaml::SecurityPolicyException("Blocked unacceptable redirect location.");
}
}
if (unsafe.first) {
HTTPResponse::getAllowedSchemes().clear();
string schemes(unsafe.second);
+ trim(schemes);
split(HTTPResponse::getAllowedSchemes(), schemes, is_space(), algorithm::token_compress_on);
}
string option(XMLHelper::getAttrString(child, nullptr, _option));
auto_ptr_char value(child->getFirstChild()->getNodeValue());
if (!provider.empty() && !option.empty() && value.get() && *value.get()) {
- m_transportOptions.push_back(make_tuple(provider, option, string(value.get())));
+ m_transportOptions.push_back(boost::make_tuple(provider, option, string(value.get())));
}
}
child = XMLHelper::getPreviousSiblingElement(child, TransportOption);
pair<bool,const char*> extraAuthTypes = inprocs->getString("extraAuthTypes");
if (extraAuthTypes.first) {
string types(extraAuthTypes.second);
+ trim(types);
split(outer->m_authTypes, types, is_space(), algorithm::token_compress_on);
outer->m_authTypes.insert("shibboleth");
}
}
}
else {
- Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+ Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
"Storage-backed RelayState with invalid StorageService ID (%s)", id
);
}
storage->createText("RelayState", rsKey.c_str(), value, time(nullptr) + 600);
}
else {
- Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+ Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
"Storage-backed RelayState with invalid StorageService ID (%s)", id
);
}
}
}
else {
- Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+ Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
"Storage-backed PostData with invalid StorageService ID (%s)", id
);
}
storage->createText("PostData", rsKey.c_str(), params.str().c_str(), time(nullptr) + 600);
}
else {
- Category::getInstance(SHIBSP_LOGCAT".ServiceProvider").error(
+ Category::getInstance(SHIBSP_LOGCAT ".ServiceProvider").error(
"Storage-backed PostData with invalid StorageService ID (%s)", id
);
}