[cpp-sp COMMIT] /branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp
noreply at shibboleth.net
noreply at shibboleth.net
Mon Apr 30 16:18:48 BST 2012
Author: scantor
Date: Mon Apr 30 16:18:48 2012
New Revision: 3634
URL: http://svn.shibboleth.net/view/cpp-sp?rev=3634&view=rev
Log:
Log requestDelegation with no entity set
Modified:
branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp
Modified: branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp?rev=3634&r1=3633&r2=3634&view=diff
==============================================================================
--- branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp (original)
+++ branches/REL_2/shibsp/handler/impl/SAML2SessionInitiator.cpp Mon Apr 30 16:18:48 2012
@@ -664,21 +664,26 @@
}
pair<bool,bool> requestDelegation = getBool("requestDelegation");
- if (requestDelegation.first && requestDelegation.second && entity.first) {
- // Request delegation by including the IdP as an Audience.
- // Also specify the expected session lifetime as the bound on the assertion lifetime.
- const PropertySet* sessionProps = app.getPropertySet("Sessions");
- pair<bool,unsigned int> lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair<bool,unsigned int>(true,28800);
- if (!lifetime.first || lifetime.second == 0)
- lifetime.second = 28800;
- if (!req->getConditions())
- req->setConditions(ConditionsBuilder::buildConditions());
- req->getConditions()->setNotOnOrAfter(time(nullptr) + lifetime.second + 300);
- AudienceRestriction* audrest = AudienceRestrictionBuilder::buildAudienceRestriction();
- req->getConditions()->getConditions().push_back(audrest);
- Audience* aud = AudienceBuilder::buildAudience();
- audrest->getAudiences().push_back(aud);
- aud->setAudienceURI(entity.first->getEntityID());
+ if (requestDelegation.first && requestDelegation.second) {
+ if (entity.first) {
+ // Request delegation by including the IdP as an Audience.
+ // Also specify the expected session lifetime as the bound on the assertion lifetime.
+ const PropertySet* sessionProps = app.getPropertySet("Sessions");
+ pair<bool,unsigned int> lifetime = sessionProps ? sessionProps->getUnsignedInt("lifetime") : pair<bool,unsigned int>(true,28800);
+ if (!lifetime.first || lifetime.second == 0)
+ lifetime.second = 28800;
+ if (!req->getConditions())
+ req->setConditions(ConditionsBuilder::buildConditions());
+ req->getConditions()->setNotOnOrAfter(time(nullptr) + lifetime.second + 300);
+ AudienceRestriction* audrest = AudienceRestrictionBuilder::buildAudienceRestriction();
+ req->getConditions()->getConditions().push_back(audrest);
+ Audience* aud = AudienceBuilder::buildAudience();
+ audrest->getAudiences().push_back(aud);
+ aud->setAudienceURI(entity.first->getEntityID());
+ }
+ else {
+ m_log.warn("requestDelegation set, but IdP unknown at request time");
+ }
}
if (ECP && entityID) {
More information about the commits
mailing list