#include "util/SPConstants.h"
#ifndef SHIBSP_LITE
+# include "metadata/MetadataProviderCriteria.h"
# include <saml/saml2/metadata/Metadata.h>
# include <saml/saml2/metadata/EndpointManager.h>
#endif
void setParent(const PropertySet* parent);
void receive(DDF& in, ostream& out);
- pair<bool,long> run(SPRequest& request, const char* entityID=NULL, bool isHandler=true) const;
+ pair<bool,long> run(SPRequest& request, string& entityID, bool isHandler=true) const;
private:
pair<bool,long> doRequest(
}
}
-pair<bool,long> Shib1SessionInitiator::run(SPRequest& request, const char* entityID, bool isHandler) const
+pair<bool,long> Shib1SessionInitiator::run(SPRequest& request, string& entityID, bool isHandler) const
{
// We have to know the IdP to function.
- if (!entityID || !*entityID)
+ if (entityID.empty())
return make_pair(false,0L);
string target;
target = option;
}
- m_log.debug("attempting to initiate session using Shibboleth with provider (%s)", entityID);
+ m_log.debug("attempting to initiate session using Shibboleth with provider (%s)", entityID.c_str());
if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess))
- return doRequest(app, request, entityID, ACSloc.c_str(), target);
+ return doRequest(app, request, entityID.c_str(), ACSloc.c_str(), target);
// Remote the call.
DDF out,in = DDF(m_address.c_str()).structure();
DDFJanitor jin(in), jout(out);
in.addmember("application_id").string(app.getId());
- in.addmember("entity_id").string(entityID);
+ in.addmember("entity_id").string(entityID.c_str());
in.addmember("acsLocation").string(ACSloc.c_str());
if (!target.empty())
in.addmember("RelayState").string(target.c_str());
// Use metadata to invoke the SSO service directly.
MetadataProvider* m=app.getMetadataProvider();
Locker locker(m);
- MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, shibspconstants::SHIB1_PROTOCOL_ENUM);
+ MetadataProviderCriteria mc(app, entityID, &IDPSSODescriptor::ELEMENT_QNAME, shibspconstants::SHIB1_PROTOCOL_ENUM);
pair<const EntityDescriptor*,const RoleDescriptor*> entity = m->getEntityDescriptor(mc);
if (!entity.first) {
m_log.warn("unable to locate metadata for provider (%s)", entityID);
auto_ptr_char dest(ep->getLocation());
string req=string(dest.get()) + (strchr(dest.get(),'?') ? '&' : '?') + "shire=" + urlenc->encode(acsLocation) +
"&time=" + timebuf + "&target=" + urlenc->encode(relayState.c_str()) +
- "&providerId=" + urlenc->encode(app.getString("entityID").second);
+ "&providerId=" + urlenc->encode(app.getRelyingParty(entity.first)->getString("entityID").second);
return make_pair(true, httpResponse.sendRedirect(req.c_str()));
#else