const char* option;
bool isPassive=false;
const Application& app=request.getApplication();
+ pair<bool,const char*> discoveryURL = pair<bool,const char*>(true, m_url);
if (isHandler) {
option = request.getParameter("SAMLDS");
option = request.getParameter("isPassive");
if (option)
isPassive = !strcmp(option,"true");
+
+ option = request.getParameter("discoveryURL");
+ if (option)
+ discoveryURL.second = option;
}
else {
// We're running as a "virtual handler" from within the filter.
target=request.getRequestURL();
pair<bool,bool> passopt = getBool("isPassive");
isPassive = passopt.first && passopt.second;
+ discoveryURL = request.getRequestSettings().first->getString("discoveryURL");
}
- m_log.debug("sending request to SAMLDS (%s)", m_url);
+ if (!discoveryURL.first)
+ discoveryURL.second = m_url;
+ m_log.debug("sending request to SAMLDS (%s)", discoveryURL.second);
// Compute the return URL. We start with a self-referential link.
string returnURL=request.getHandlerURL(target.c_str());
returnURL = returnURL + "&target=" + urlenc->encode(target.c_str());;
}
- string req=string(m_url) + (strchr(m_url,'?') ? '&' : '?') + "entityID=" + urlenc->encode(app.getString("entityID").second) +
+ string req=string(discoveryURL.second) + (strchr(discoveryURL.second,'?') ? '&' : '?') + "entityID=" + urlenc->encode(app.getString("entityID").second) +
"&return=" + urlenc->encode(returnURL.c_str());
if (m_returnParam)
req = req + "&returnIDParam=" + m_returnParam;
const char* option;
const Handler* ACS=NULL;
const Application& app=request.getApplication();
+ pair<bool,const char*> discoveryURL = pair<bool,const char*>(true, m_url);
if (isHandler) {
option=request.getParameter("acsIndex");
if (option)
target = option;
recoverRelayState(request.getApplication(), request, request, target, false);
+
+ option = request.getParameter("discoveryURL");
+ if (option)
+ discoveryURL.second = option;
}
else {
// We're running as a "virtual handler" from within the filter.
// The target resource is the current one and everything else is defaulted.
target=request.getRequestURL();
+ discoveryURL = request.getRequestSettings().first->getString("discoveryURL");
}
// Since we're not passing by index, we need to fully compute the return URL.
}
}
- m_log.debug("sending request to WAYF (%s)", m_url);
+ if (!discoveryURL.first)
+ discoveryURL.second = m_url;
+ m_log.debug("sending request to WAYF (%s)", discoveryURL.second);
// Compute the ACS URL. We add the ACS location to the base handlerURL.
string ACSloc=request.getHandlerURL(target.c_str());
char timebuf[16];
sprintf(timebuf,"%lu",time(NULL));
const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder();
- string req=string(m_url) + (strchr(m_url,'?') ? '&' : '?') + "shire=" + urlenc->encode(ACSloc.c_str()) +
+ string req=string(discoveryURL.second) + (strchr(discoveryURL.second,'?') ? '&' : '?') + "shire=" + urlenc->encode(ACSloc.c_str()) +
"&time=" + timebuf + "&target=" + urlenc->encode(target.c_str()) +
"&providerId=" + urlenc->encode(app.getString("entityID").second);