-
- request.setHeader("Shib-Application-ID", app->getId());
- request.setHeader("Shib-Session-ID", session->getID());
-
- // Export the IdP name and Authn method/context info.
- const char* hval = session->getEntityID();
- if (hval)
- request.setHeader("Shib-Identity-Provider", hval);
- hval = session->getAuthnInstant();
- if (hval)
- request.setHeader("Shib-Authentication-Instant", hval);
- hval = session->getAuthnContextClassRef();
- if (hval) {
- request.setHeader("Shib-Authentication-Method", hval);
- request.setHeader("Shib-AuthnContext-Class", hval);
+
+ pair<bool,const char*> enc = settings.first->getString("encoding");
+ if (enc.first && strcmp(enc.second, "URL"))
+ throw ConfigurationException("Unsupported value for 'encoding' content setting ($1).", params(1,enc.second));
+
+ const URLEncoder* encoder = XMLToolingConfig::getConfig().getURLEncoder();
+
+ app->setHeader(request, "Shib-Application-ID", app->getId());
+ app->setHeader(request, "Shib-Session-ID", session->getID());
+
+ // Check for export of "standard" variables.
+ // A 3.0 release would switch this default to false and rely solely on the
+ // Assertion extractor plugin and ship out of the box with the same defaults.
+ pair<bool,bool> stdvars = settings.first->getBool("exportStdVars");
+ if (!stdvars.first || stdvars.second) {
+ const char* hval = session->getEntityID();
+ if (hval)
+ app->setHeader(request, "Shib-Identity-Provider", hval);
+ hval = session->getAuthnInstant();
+ if (hval)
+ app->setHeader(request, "Shib-Authentication-Instant", hval);
+ hval = session->getAuthnContextClassRef();
+ if (hval) {
+ app->setHeader(request, "Shib-Authentication-Method", hval);
+ app->setHeader(request, "Shib-AuthnContext-Class", hval);
+ }
+ hval = session->getAuthnContextDeclRef();
+ if (hval)
+ app->setHeader(request, "Shib-AuthnContext-Decl", hval);
+ hval = session->getSessionIndex();
+ if (hval)
+ app->setHeader(request, "Shib-Session-Index", hval);
+ }
+
+ // Check for export of algorithmically-derived portion of cookie names.
+ stdvars = settings.first->getBool("exportCookie");
+ if (stdvars.first && stdvars.second) {
+ pair<string,const char*> cookieprops = app->getCookieNameProps(nullptr);
+ app->setHeader(request, "Shib-Cookie-Name", cookieprops.first.c_str());