public class SAMLAttribute
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
XSITYPE_NONE |
static java.lang.String |
XSITYPE_XSD_BASE64BINARY |
static java.lang.String |
XSITYPE_XSD_STRING |
Constructor and Description |
---|
SAMLAttribute(SAMLAttribute anAttribute)
Constructs a new SAMLAttribute that is a copy of the argument SAMLAttribute.
|
SAMLAttribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
OMStructure[] omAttributeValue,
java.lang.String attributeNamespace,
java.lang.String nameFormat,
java.lang.String friendlyName)
Constructs a new SAMLAttribute supporting OMStructure.
|
SAMLAttribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
OMStructure[] omAttributeValue,
java.lang.String attributeNamespace,
java.lang.String nameFormat,
java.lang.String friendlyName,
java.lang.String encoding,
java.lang.String xsiType)
Constructs a new SAMLAttribute supporting OMStructure and the additional parameters required for X:500 LDAP.
|
SAMLAttribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
com.ibm.websphere.wssecurity.wssapi.XMLStructure[] xmlAttributeValue,
java.lang.String attributeNamespace,
java.lang.String nameFormat,
java.lang.String friendlyName)
Constructs a new SAMLAttribute supporting XMLStructure.
|
Modifier and Type | Method and Description |
---|---|
static SAMLAttribute |
buildSAML11Attribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
OMStructure[] omAttributeValue,
java.lang.String attributeNamespace)
Create a
SAMLAttribute that is valid for the SAML 1.1 schema. |
static SAMLAttribute |
buildSAML20Attribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
OMStructure[] omAttributeValue,
java.lang.String nameFormat,
java.lang.String friendlyName)
Create a
SAMLAttribute that is valid for the SAML 2.0 schema. |
static SAMLAttribute |
buildSAML20LDAPBase64TypeAttribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
java.lang.String friendlyName)
Create a
SAMLAttribute that is valid for the SAML 2.0 X.500 LDAP Attribute
Profile with an AttributeValue that has xsi:type="xsd:base64Binary" |
static SAMLAttribute |
buildSAML20LDAPStringTypeAttribute(java.lang.String name,
java.lang.String[] stringAttributeValue,
java.lang.String friendlyName)
Create a
SAMLAttribute that is valid for the SAML 2.0 X.500 LDAP Attribute
Profile with an AttributeValue that has xsi:type="xsd:string". |
void |
enforceSaml11()
Removes values from the attribute that are not supported by the SAML v1.1 token type
|
void |
enforceSaml20()
Removes values from the attribute that are not supported by the SAML v2.0 token type
|
java.lang.String |
getAttributeNamespace()
Returns the attribute's namespace.
|
java.lang.String |
getEncoding()
Returns the Encoding setting.
|
java.lang.String |
getFriendlyName()
Returns the friendly name of the SAML Attribute.
|
boolean |
getLdapType()
Use this method to see if a SAMLAttribute is X.500 LDAP.
|
java.lang.String |
getName()
Returns the name of the attribute.
|
java.lang.String |
getNameFormat()
Returns the attribute attribute's format that specifies how the attribute will be interpreted.
|
OMStructure[] |
getOMAttributeValue()
Returns an array of the SAMLAttribute's values in OMElement representation.
|
java.lang.String[] |
getStringAttributeValue()
Returns an array of this SAML attribute's values in string representation.
|
com.ibm.websphere.wssecurity.wssapi.XMLStructure[] |
getXMLAttributeValue()
Returns an array of this SAML attribute's values in XML form.
|
java.lang.String |
getXsiType()
Returns the value for the xsi:type for the AttributeValue
|
void |
setEncoding(java.lang.String encoding)
Sets the x500:Encoding attribute
|
void |
setLdapType(boolean setting)
Sets the SAMLAttribute to be a SAML 2.0 X.500 LDAP Attribute
|
void |
setXsiType(java.lang.String type)
Sets the xsi:type for the AttributeValue
|
public static java.lang.String XSITYPE_NONE
public static java.lang.String XSITYPE_XSD_STRING
public static java.lang.String XSITYPE_XSD_BASE64BINARY
public SAMLAttribute(java.lang.String name, java.lang.String[] stringAttributeValue, com.ibm.websphere.wssecurity.wssapi.XMLStructure[] xmlAttributeValue, java.lang.String attributeNamespace, java.lang.String nameFormat, java.lang.String friendlyName)
name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.xmlAttributeValue
- XMLStructure
array containing attribute values in XML form.attributeNamespace
- attribute's namespacenameFormat
- attribute's format that specifies how the attribute will be interpreted. For example, "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"friendlyName
- a friendly name for the attribute, in case the attribute's name is cryptic.public SAMLAttribute(java.lang.String name, java.lang.String[] stringAttributeValue, OMStructure[] omAttributeValue, java.lang.String attributeNamespace, java.lang.String nameFormat, java.lang.String friendlyName)
name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.omAttributeValue
- OMStructure
array containing attribute values in OMElement
form.attributeNamespace
- attribute's namespacenameFormat
- attribute's format that specifies how the attribute will be interpreted. For example, "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"friendlyName
- a friendly name for the attribute, in case the attribute's name is cryptic.public SAMLAttribute(SAMLAttribute anAttribute)
anAttribute
- SAMLAttribute
to copypublic SAMLAttribute(java.lang.String name, java.lang.String[] stringAttributeValue, OMStructure[] omAttributeValue, java.lang.String attributeNamespace, java.lang.String nameFormat, java.lang.String friendlyName, java.lang.String encoding, java.lang.String xsiType)
name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.omAttributeValue
- OMStructure
array containing attribute values in OMElement
form.attributeNamespace
- attribute's namespacenameFormat
- attribute's format that specifies how the attribute will be interpreted. For example, "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"friendlyName
- a friendly name for the attribute, in case the attribute's name is cryptic.encoding
- attribute's encoding. For example, "LDAP"xsiType
- xsi:type for the AttributeValue. For example, "xsd:string" or "xsd:base64Binary"public static SAMLAttribute buildSAML20Attribute(java.lang.String name, java.lang.String[] stringAttributeValue, OMStructure[] omAttributeValue, java.lang.String nameFormat, java.lang.String friendlyName)
SAMLAttribute
that is valid for the SAML 2.0 schema.name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.omAttributeValue
- OMStructure
array containing attribute values in OMElement
form.nameFormat
- attribute's format that specifies how the attribute will be interpreted. For example, "urn:oasis:names:tc:SAML:2.0:attrname-format:uri"friendlyName
- a friendly name for the attribute, in case the attribute's name is cryptic.SAMLAttribute
to use with SAML APIspublic static SAMLAttribute buildSAML11Attribute(java.lang.String name, java.lang.String[] stringAttributeValue, OMStructure[] omAttributeValue, java.lang.String attributeNamespace)
SAMLAttribute
that is valid for the SAML 1.1 schema.name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.omAttributeValue
- OMStructure
array containing attribute values in OMElement
form.attributeNamespace
- attribute's namespaceSAMLAttribute
to use with SAML APIspublic static SAMLAttribute buildSAML20LDAPStringTypeAttribute(java.lang.String name, java.lang.String[] stringAttributeValue, java.lang.String friendlyName)
SAMLAttribute
that is valid for the SAML 2.0 X.500 LDAP Attribute
Profile with an AttributeValue that has xsi:type="xsd:string".
buildSAML20LDAPStringTypeAttribute("urn:oid:2.5.4.42", new String[]{"Steven"},"givenName");
<saml:Attribute xmlns:x500="urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
Name="urn:oid:2.5.4.42" FriendlyName="givenName" x500:Encoding="LDAP"\>
<saml:AttributeValue xsi:type="xsd:string">Steven</saml:AttributeValue></saml:Attribute>
name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.friendlyName
- a friendly name for the attribute, in case the attribute's name is cryptic.SAMLAttribute
to use with SAML APIspublic static SAMLAttribute buildSAML20LDAPBase64TypeAttribute(java.lang.String name, java.lang.String[] stringAttributeValue, java.lang.String friendlyName)
SAMLAttribute
that is valid for the SAML 2.0 X.500 LDAP Attribute
Profile with an AttributeValue that has xsi:type="xsd:base64Binary"name
- name of the SAML AttributestringAttributeValue
- String array containing attribute values in string form.friendlyName
- a friendly name for the attribute, in case the attribute's name is cryptic.SAMLAttribute
to use with SAML APIspublic java.lang.String getName()
public java.lang.String getNameFormat()
public java.lang.String getAttributeNamespace()
public java.lang.String[] getStringAttributeValue()
public com.ibm.websphere.wssecurity.wssapi.XMLStructure[] getXMLAttributeValue()
public java.lang.String getFriendlyName()
public void enforceSaml20()
public void enforceSaml11()
public void setLdapType(boolean setting)
setting
- if true
, Encoding is set to "LDAP" and xsiType is set to "xsd:string".public boolean getLdapType()
true
if the x500:Encoding attribute is set to "LDAP",
otherwise false
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
encoding
- attribute's encoding. For example, "LDAP"public java.lang.String getXsiType()
public void setXsiType(java.lang.String type)
type
- xsi:type for the AttributeValue. For example, "xsd:string" or "xsd:base64Binary"public OMStructure[] getOMAttributeValue()
OMStructure
array of SAMLAttribute's AttributeValues