* @param in input object containing marshalled NameIDAttribute
*/
NameIDAttribute(DDF& in) : Attribute(in) {
+ DDF val = in["_formatter"];
+ if (val.isstring())
+ m_formatter = val.string();
+ else
+ m_formatter = DEFAULT_NAMEID_FORMATTER;
const char* pch;
- DDF val = in.first().first();
+ val = in.first().first();
while (val.name()) {
m_values.push_back(Value());
Value& v = m_values.back();
DDF marshall() const {
DDF ddf = Attribute::marshall();
ddf.name("NameID");
+ ddf.addmember("_formatter").string(m_formatter.c_str());
DDF vlist = ddf.first();
for (std::vector<Value>::const_iterator i=m_values.begin(); i!=m_values.end(); ++i) {
DDF val = DDF(i->m_Name.c_str()).structure();
/**
* Constructor
*
- * @param id Attribute identifier
+ * @param id Attribute identifier
+ * @param delimeter value/scope delimeter when serializing
*/
- ScopedAttribute(const char* id) : Attribute(id) {}
+ ScopedAttribute(const char* id, char delimeter='@') : Attribute(id), m_delimeter(delimeter) {}
/**
* Constructs based on a remoted ScopedAttribute.
*
* @param in input object containing marshalled ScopedAttribute
*/
- ScopedAttribute(DDF& in) : Attribute(in) {
- DDF val = in.first().first();
+ ScopedAttribute(DDF& in) : Attribute(in), m_delimeter('@') {
+ DDF val = in["_delimeter"];
+ if (val.isint())
+ m_delimeter = static_cast<char>(val.integer());
+ val = in.first().first();
while (val.name() && val.string()) {
m_values.push_back(std::make_pair(val.name(), val.string()));
val = in.first().next();
const std::vector<std::string>& getSerializedValues() const {
if (m_serialized.empty()) {
for (std::vector< std::pair<std::string,std::string> >::const_iterator i=m_values.begin(); i!=m_values.end(); ++i)
- m_serialized.push_back(i->first + '@' + i->second);
+ m_serialized.push_back(i->first + m_delimeter + i->second);
}
return Attribute::getSerializedValues();
}
DDF marshall() const {
DDF ddf = Attribute::marshall();
ddf.name("Scoped");
+ if (m_delimeter != '@')
+ ddf.addmember("_delimeter").integer(m_delimeter);
DDF vlist = ddf.first();
for (std::vector< std::pair<std::string,std::string> >::const_iterator i=m_values.begin(); i!=m_values.end(); ++i) {
DDF val = DDF(i->first.c_str()).string(i->second.c_str());
}
private:
+ char m_delimeter;
std::vector< std::pair<std::string,std::string> > m_values;
};
char* scope;\r
const XMLCh* xmlscope;\r
QName scopeqname(NULL,Scope);\r
- auto_ptr<ScopedAttribute> scoped(new ScopedAttribute(id));\r
+ auto_ptr<ScopedAttribute> scoped(new ScopedAttribute(id,m_delimeter));\r
scoped->setCaseSensitive(m_caseSensitive);\r
vector< pair<string,string> >& dest = scoped->getValues();\r
vector<XMLObject*>::const_iterator v,stop;\r
m_log.debug("SSO profile processing completed successfully");
+ NameIdentifier* n = ssoStatement->getSubject()->getNameIdentifier();
+
// We've successfully "accepted" at least one SSO token, along with any additional valid tokens.
// To complete processing, we need to extract and resolve attributes and then create the session.
multimap<string,Attribute*> resolvedAttributes;
AttributeExtractor* extractor = application.getAttributeExtractor();
if (extractor) {
+ m_log.debug("extracting pushed attributes...");
Locker extlocker(extractor);
+ if (n) {
+ try {
+ extractor->extractAttributes(application, policy.getIssuerMetadata(), *n, resolvedAttributes);
+ }
+ catch (exception& ex) {
+ m_log.error("caught exception extracting attributes: %s", ex.what());
+ }
+ }
for (vector<const opensaml::Assertion*>::const_iterator t = tokens.begin(); t!=tokens.end(); ++t) {
try {
extractor->extractAttributes(application, policy.getIssuerMetadata(), *(*t), resolvedAttributes);
}
// First, normalize the SAML 1.x NameIdentifier...
- NameIdentifier* n = ssoStatement->getSubject()->getNameIdentifier();
auto_ptr<NameID> nameid(n ? NameIDBuilder::buildNameID() : NULL);
if (n) {
nameid->setName(n->getName());
multimap<string,Attribute*> resolvedAttributes;
AttributeExtractor* extractor = application.getAttributeExtractor();
if (extractor) {
+ m_log.debug("extracting pushed attributes...");
Locker extlocker(extractor);
+ try {
+ extractor->extractAttributes(application, policy.getIssuerMetadata(), *ssoName, resolvedAttributes);
+ }
+ catch (exception& ex) {
+ m_log.error("caught exception extracting attributes: %s", ex.what());
+ }
for (vector<const opensaml::Assertion*>::const_iterator t = tokens.begin(); t!=tokens.end(); ++t) {
try {
extractor->extractAttributes(application, policy.getIssuerMetadata(), *(*t), resolvedAttributes);
if (!req->getIssuer()) {
Issuer* issuer = IssuerBuilder::buildIssuer();
req->setIssuer(issuer);
- issuer->setName(app.getXMLString("providerId").second);
+ issuer->setName(app.getXMLString("entityID").second);
}
if (!req->getNameIDPolicy()) {
NameIDPolicy* namepol = NameIDPolicyBuilder::buildNameIDPolicy();