[cpp-sp COMMIT] in /branches/REL_2: adfs/adfs.cpp configs/shibd.logger.in schemas/shibboleth-2.0-native-sp-config.xsd...

noreply at shibboleth.net noreply at shibboleth.net
Sun Oct 30 21:36:19 GMT 2011


Author: scantor
Date: Sun Oct 30 21:36:19 2011
New Revision: 3534

URL: http://svn.shibboleth.net/view/cpp-sp?rev=3534&view=rev
Log:
https://issues.shibboleth.net/jira/browse/SSPCPP-349

Added:
    branches/REL_2/shibsp/impl/TransactionLog.cpp
Modified:
    branches/REL_2/adfs/adfs.cpp
    branches/REL_2/configs/shibd.logger.in
    branches/REL_2/schemas/shibboleth-2.0-native-sp-config.xsd
    branches/REL_2/shibsp/Makefile.am
    branches/REL_2/shibsp/SPConfig.cpp
    branches/REL_2/shibsp/SPConfig.h
    branches/REL_2/shibsp/SessionCache.h
    branches/REL_2/shibsp/TransactionLog.h
    branches/REL_2/shibsp/handler/AssertionConsumerService.h
    branches/REL_2/shibsp/handler/LogoutHandler.h
    branches/REL_2/shibsp/handler/SessionInitiator.h
    branches/REL_2/shibsp/handler/impl/AssertionConsumerService.cpp
    branches/REL_2/shibsp/handler/impl/LocalLogoutInitiator.cpp
    branches/REL_2/shibsp/handler/impl/LogoutHandler.cpp
    branches/REL_2/shibsp/handler/impl/SAML1Consumer.cpp
    branches/REL_2/shibsp/handler/impl/SAML2Consumer.cpp
    branches/REL_2/shibsp/handler/impl/SAML2Logout.cpp
    branches/REL_2/shibsp/handler/impl/SAML2LogoutInitiator.cpp
    branches/REL_2/shibsp/handler/impl/SAML2NameIDMgmt.cpp
    branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp
    branches/REL_2/shibsp/handler/impl/SessionInitiator.cpp
    branches/REL_2/shibsp/handler/impl/Shib1SessionInitiator.cpp
    branches/REL_2/shibsp/impl/StorageServiceSessionCache.cpp
    branches/REL_2/shibsp/impl/XMLServiceProvider.cpp
    branches/REL_2/shibsp/shibsp.vcxproj
    branches/REL_2/shibsp/shibsp.vcxproj.filters

Modified: branches/REL_2/adfs/adfs.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/adfs/adfs.cpp?rev=3534&r1=3533&r2=3534&view=diff
==============================================================================
--- branches/REL_2/adfs/adfs.cpp (original)
+++ branches/REL_2/adfs/adfs.cpp Sun Oct 30 21:36:19 2011
@@ -45,6 +45,7 @@
 #include <shibsp/SessionCache.h>
 #include <shibsp/SPConfig.h>
 #include <shibsp/SPRequest.h>
+#include <shibsp/TransactionLog.h>
 #include <shibsp/handler/AssertionConsumerService.h>
 #include <shibsp/handler/LogoutInitiator.h>
 #include <shibsp/handler/SessionInitiator.h>
@@ -510,6 +511,14 @@
 
     preserveRelayState(app, httpResponse, relayState);
 
+    auto_ptr<AuthnRequestEvent> ar_event(newAuthnRequestEvent(app, httpRequest));
+    if (ar_event.get()) {
+        ar_event->m_binding = WSFED_NS;
+        ar_event->m_protocol = WSFED_NS;
+        ar_event->m_peer = entity.first;
+        app.getServiceProvider().getTransactionLog()->write(*ar_event);
+    }
+
     // UTC timestamp
     time_t epoch=time(nullptr);
 #ifndef HAVE_GMTIME_R
@@ -769,7 +778,9 @@
         tokens.insert(tokens.end(), ctx->getResolvedAssertions().begin(), ctx->getResolvedAssertions().end());
     }
 
+    string session_id;
     application.getServiceProvider().getSessionCache()->insert(
+        session_id,
         application,
         httpRequest,
         httpResponse,
@@ -784,6 +795,20 @@
         &tokens,
         ctx.get() ? &ctx->getResolvedAttributes() : nullptr
         );
+
+    auto_ptr<LoginEvent> login_event(newLoginEvent(application, httpRequest));
+    if (login_event.get()) {
+        login_event->m_sessionID = session_id.c_str();
+        login_event->m_peer = entity;
+        login_event->m_protocol = WSFED_NS;
+        login_event->m_binding = WSFED_NS;
+        login_event->m_saml1AuthnStatement = saml1statement;
+        login_event->m_nameID = (saml1name ? nameid.get() : saml2name);
+        login_event->m_saml2AuthnStatement = saml2statement;
+        if (ctx.get())
+            login_event->m_attributes = &ctx->getResolvedAttributes();
+        application.getServiceProvider().getTransactionLog()->write(*login_event);
+    }
 }
 
 #endif
@@ -813,7 +838,6 @@
         return make_pair(false,0L);
     }
 
-    string entityID(session->getEntityID());
     session->unlock();
 
     if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
@@ -824,6 +848,7 @@
         // When not out of process, we remote the request.
         session->unlock();
         vector<string> headers(1,"Cookie");
+        headers.push_back("User-Agent");
         DDF out,in = wrap(request,&headers);
         DDFJanitor jin(in), jout(out);
         out=request.getServiceProvider().getListenerService()->send(in);
@@ -872,9 +897,9 @@
             doRequest(*app, *req.get(), *resp.get(), session);
         }
         else {
-             m_log.error("no issuing entityID found in session");
-             session->unlock();
-             app->getServiceProvider().getSessionCache()->remove(*app, *req.get(), resp.get());
+            m_log.error("no issuing entityID found in session");
+            session->unlock();
+            app->getServiceProvider().getSessionCache()->remove(*app, *req.get(), resp.get());
         }
     }
     out << ret;
@@ -890,6 +915,13 @@
     // Do back channel notification.
     vector<string> sessions(1, session->getID());

[... 1990 lines stripped ...]


More information about the commits mailing list