/*
- * Copyright 2001-2009 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
)
{
// The properties we need can be set in the RequestMap, or the Errors element.
- bool mderror = dynamic_cast<const opensaml::saml2md::MetadataException*>(tp.getRichException())!=NULL;
+ bool mderror = dynamic_cast<const opensaml::saml2md::MetadataException*>(tp.getRichException())!=nullptr;
bool accesserror = (strcmp(page, "access")==0);
- pair<bool,const char*> redirectErrors = pair<bool,const char*>(false,NULL);
- pair<bool,const char*> pathname = pair<bool,const char*>(false,NULL);
+ pair<bool,const char*> redirectErrors = pair<bool,const char*>(false,nullptr);
+ pair<bool,const char*> pathname = pair<bool,const char*>(false,nullptr);
- // Strictly for error handling, detect a NULL application and point at the default.
+ // Strictly for error handling, detect a nullptr application and point at the default.
if (!app)
- app = request.getServiceProvider().getApplication("default");
+ app = request.getServiceProvider().getApplication(nullptr);
const PropertySet* props=app->getPropertySet("Errors");
void SHIBSP_DLLLOCAL clearHeaders(SPRequest& request) {
const Application& app = request.getApplication();
app.clearHeader(request, "Shib-Session-ID", "HTTP_SHIB_SESSION_ID");
+ app.clearHeader(request, "Shib-Session-Index", "HTTP_SHIB_SESSION_INDEX");
app.clearHeader(request, "Shib-Identity-Provider", "HTTP_SHIB_IDENTITY_PROVIDER");
app.clearHeader(request, "Shib-Authentication-Method", "HTTP_SHIB_AUTHENTICATION_METHOD");
app.clearHeader(request, "Shib-Authentication-Instant", "HTTP_SHIB_AUTHENTICATION_INSTANT");
{
}
+#ifndef SHIBSP_LITE
+SecurityPolicyProvider* ServiceProvider::getSecurityPolicyProvider(bool required) const
+{
+ if (required)
+ throw ConfigurationException("No SecurityPolicyProvider available.");
+ return NULL;
+}
+#endif
+
pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handler) const
{
#ifdef _DEBUG
#endif
Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
- const Application* app=NULL;
+ const Application* app=nullptr;
string targetURL = request.getRequestURL();
try {
// Fix for secadv 20050901
clearHeaders(request);
- Session* session = NULL;
+ Session* session = nullptr;
try {
session = request.getSession();
}
catch (exception& e) {
log.warn("error during session lookup: %s", e.what());
// If it's not a retryable session failure, we throw to the outer handler for reporting.
- if (dynamic_cast<opensaml::RetryableProfileException*>(&e)==NULL)
+ if (dynamic_cast<opensaml::RetryableProfileException*>(&e)==nullptr)
throw;
}
return make_pair(true,request.returnOK());
// No session, but we require one. Initiate a new session using the indicated method.
- const SessionInitiator* initiator=NULL;
+ const SessionInitiator* initiator=nullptr;
if (requireSessionWith.first) {
initiator=app->getSessionInitiatorById(requireSessionWith.second);
if (!initiator) {
#endif
Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
- const Application* app=NULL;
+ const Application* app=nullptr;
string targetURL = request.getRequestURL();
try {
// Do we have an access control plugin?
if (settings.second) {
- const Session* session = NULL;
+ const Session* session = nullptr;
try {
session = request.getSession(false);
}
#endif
Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
- const Application* app=NULL;
+ const Application* app=nullptr;
string targetURL = request.getRequestURL();
try {
RequestMapper::Settings settings = request.getRequestSettings();
app = &(request.getApplication());
- const Session* session = NULL;
+ const Session* session = nullptr;
try {
session = request.getSession(false);
}
hval = session->getAuthnContextDeclRef();
if (hval)
app->setHeader(request, "Shib-AuthnContext-Decl", hval);
+ hval = session->getSessionIndex();
+ if (hval)
+ app->setHeader(request, "Shib-Session-Index", hval);
// Maybe export the assertion keys.
pair<bool,bool> exp=settings.first->getBool("exportAssertion");
if (exp.first && exp.second) {
const PropertySet* sessions=app->getPropertySet("Sessions");
- pair<bool,const char*> exportLocation = sessions ? sessions->getString("exportLocation") : pair<bool,const char*>(false,NULL);
+ pair<bool,const char*> exportLocation = sessions ? sessions->getString("exportLocation") : pair<bool,const char*>(false,nullptr);
if (!exportLocation.first)
log.warn("can't export assertions without an exportLocation Sessions property");
else {
#endif
Category& log = Category::getInstance(SHIBSP_LOGCAT".ServiceProvider");
- const Application* app=NULL;
+ const Application* app=nullptr;
string targetURL = request.getRequestURL();
try {