const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, vector<Attribute*>& attributes
) const
{
- const EntityDescriptor* entity = dynamic_cast<const EntityDescriptor*>(&xmlObject);
- if (!entity || !issuer)
+ const RoleDescriptor* role = dynamic_cast<const RoleDescriptor*>(&xmlObject);
+ if (!role)
return;
vector<const Credential*> creds;
- MetadataCredentialCriteria mcc(*issuer);
+ MetadataCredentialCriteria mcc(*role);
if (!m_signingId.empty()) {
mcc.setUsage(Credential::SIGNING_CREDENTIAL);
/*
- * Copyright 2001-2007 Internet2
+ * Copyright 2001-2009 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Check for metadata.
if (XMLString::equals(xmlObject.getElementQName().getNamespaceURI(), samlconstants::SAML20MD_NS)) {
- const EntityDescriptor* entityToExtract = dynamic_cast<const EntityDescriptor*>(&xmlObject);
+ const RoleDescriptor* roleToExtract = dynamic_cast<const RoleDescriptor*>(&xmlObject);
+ const EntityDescriptor* entityToExtract = roleToExtract ? dynamic_cast<const EntityDescriptor*>(roleToExtract->getParent()) : NULL;
if (!entityToExtract)
throw AttributeExtractionException("Unable to extract attributes, unknown metadata object type.");
const Extensions* ext = entityToExtract->getExtensions();
const vector<const Assertion*>* tokens
) const
{
- const saml2md::EntityDescriptor* entity = issuer ? dynamic_cast<const saml2md::EntityDescriptor*>(issuer->getParent()) : NULL;
-
// First we do the extraction of any pushed information, including from metadata.
vector<Attribute*> resolvedAttributes;
AttributeExtractor* extractor = application.getAttributeExtractor();
if (extractor) {
Locker extlocker(extractor);
- if (entity) {
+ if (issuer) {
pair<bool,const char*> mprefix = application.getString("metadataAttributePrefix");
if (mprefix.first) {
m_log.debug("extracting metadata-derived attributes...");
try {
// We pass NULL for "issuer" because the IdP isn't the one asserting metadata-based attributes.
- extractor->extractAttributes(application, NULL, *entity, resolvedAttributes);
+ extractor->extractAttributes(application, NULL, *issuer, resolvedAttributes);
for (vector<Attribute*>::iterator a = resolvedAttributes.begin(); a != resolvedAttributes.end(); ++a) {
vector<string>& ids = (*a)->getAliases();
for (vector<string>::iterator id = ids.begin(); id != ids.end(); ++id)
auto_ptr<ResolutionContext> ctx(
resolver->createResolutionContext(
application,
- entity,
+ issuer ? dynamic_cast<const saml2md::EntityDescriptor*>(issuer->getParent()) : NULL,
protocol,
nameid,
authncontext_class,