/** * Populates the attribute with attribute name and namespace. * * @param attribute to populate */ protected void populateAttribute(Attribute attribute) { attribute.setAttributeName(getAttributeName()); attribute.setAttributeNamespace(getNamespace()); } }
/** {@inheritDoc} */ public Attribute encode(BaseAttribute attribute) throws AttributeEncodingException { Attribute samlAttribute = attributeBuilder.buildObject(); samlAttribute.setAttributeName(getAttributeName()); samlAttribute.setAttributeNamespace(getNamespace()); samlAttribute.getAttributeValues() .addAll(encodeAttributeValues(AttributeValue.DEFAULT_ELEMENT_NAME, attribute)); List<XMLObject> attributeValues = samlAttribute.getAttributeValues(); if (attributeValues == null || attributeValues.isEmpty()) { log.debug("Unable to encode {} attribute. It does not contain any values", attribute.getId()); return null; } return samlAttribute; }
attribute.setAttributeName(e.getKey()); attribute.setAttributeNamespace(NAMESPACE); attribute.setAttributeName(this.rememberMeAttributeName); attribute.setAttributeNamespace(NAMESPACE); attribute.getAttributeValues().add(newAttributeValue(REMEMBER_ME_ATTRIBUTE_VALUE, attrStatement));
/** * Creates a SAML attribute similar to following, * <pre> <saml:Attribute * AttributeName="MemberLevel" * AttributeNamespace="http://www.oasis.open.org/Catalyst2002/attributes"> * <saml:AttributeValue>gold</saml:AttributeValue> * </saml:Attribute></pre> * @param name attribute name * @param namespace attribute namespace. * @param value attribute value. * @return OpenSAML representation of the attribute. * @throws org.apache.rahas.TrustException If unable to find the appropriate builder. */ public static Attribute createAttribute(String name, String namespace, String value) throws TrustException { Attribute attribute = (Attribute)CommonUtil.buildXMLObject(Attribute.DEFAULT_ELEMENT_NAME); attribute.setAttributeName(name); attribute.setAttributeNamespace(namespace); XSStringBuilder attributeValueBuilder = (XSStringBuilder)Configuration.getBuilderFactory(). getBuilder(XSString.TYPE_NAME); XSString stringValue = attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME); stringValue.setValue(value); attribute.getAttributeValues().add(stringValue); return attribute; }
attribute.setAttributeName(attributeName); attribute.setAttributeNamespace(attributeUrn);
attribute.setAttributeName(attributeName); attribute.setAttributeNamespace(attributeUrn);
attribute.setAttributeName(attrName); attribute.setAttributeNamespace(attrNamespace);
attribute.setAttributeName(attrName); attribute.setAttributeNamespace(attrNamespace);