private SAMLAttribute[] getAttributesFor(final SAMLAssertion assertion, final SAMLSubject subject) { final List attributes = new ArrayList(); for (final Iterator iter = assertion.getStatements(); iter.hasNext();) { final SAMLStatement statement = (SAMLStatement) iter.next(); if (statement instanceof SAMLAttributeStatement) { final SAMLAttributeStatement attributeStatement = (SAMLAttributeStatement) statement; // used because SAMLSubject does not implement equals if (subject.getNameIdentifier().getName().equals(attributeStatement.getSubject().getNameIdentifier().getName())) { for (final Iterator iter2 = attributeStatement.getAttributes(); iter2.hasNext();) attributes.add(iter2.next()); } } } return (SAMLAttribute[]) attributes.toArray(new SAMLAttribute[attributes.size()]); }
SAMLAttributeStatement attrStatement = new SAMLAttributeStatement(); SAMLAttribute attr1 = new SAMLAttribute(); attr1.setName("proxyGrantingTicket"); attr2.addValue(proxies); attrStatement.addAttribute(attr1); attrStatement.addAttribute(attr2); attrStatement.setSubject(subjectInAttr);
if (lStatement instanceof SAMLAttributeStatement) { SAMLAttributeStatement lSAMLAttributeStatement = (SAMLAttributeStatement) lStatement; Iterator lAttributes = lSAMLAttributeStatement.getAttributes(); while (lAttributes.hasNext()) { SAMLAttribute lSAMLAttribute = (SAMLAttribute) lAttributes.next();
SAMLAttributeStatement attrStatement = new SAMLAttributeStatement(); SAMLAttribute attr1 = new SAMLAttribute(); attr1.setName("proxyGrantingTicket"); attr2.addValue(proxies); attrStatement.addAttribute(attr1); attrStatement.addAttribute(attr2); attrStatement.setSubject(subjectInAttr);
SAMLAttributeStatement samlAttrStatement = (SAMLAttributeStatement) tSamlStatement; Iterator itrSamlAttributes = samlAttrStatement.getAttributes(); while (itrSamlAttributes.hasNext()) { SAMLAttribute tAtt = (SAMLAttribute) itrSamlAttributes