- // Export the IdP name and Authn method/context info.
- 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);
+ // 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());