Class SAML2Config
- java.lang.Object
-
- org.forgerock.openam.sts.config.user.SAML2Config
-
@SupportedAll public class SAML2Config extends Object
Encapsulates the configuration state necessary to produce SAML2 assertions. Each published rest-sts instance will encapsulate state to allow it to issue saml2 assertions for a single SP. Thus the spEntityId, and spAcsUrl (the url of the SP's assertion consumer service) are specified in this class. The signatureAlias corresponds to the IDP's signing key, and the encryptionKeyAlias could correspond to the SP's public key corresponding to the key used to encrypt the symmetric key used to encrypt assertion elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSAML2Config.SAML2ConfigBuilderBuilder used to programmatically create SAML2Config objects
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SAML2Config.SAML2ConfigBuilderbuilder()Creates a newSAML2ConfigBuilder.booleanencryptAssertion()Gets whether the assertion should be encrypted.booleanencryptAttributes()Gets whether the attributes should be encrypted.booleanencryptNameID()Gets whether the name-id should be encrypted.booleanequals(Object other)static SAML2ConfigfromJson(JsonValue json)Creates a SAML2Config object from aJsonValuerepresentationstatic SAML2ConfigfromSmsJson(JsonValue json)Creates a SAML2Config object from a SMSJsonValuerepresentationMap<String,String>getAttributeMap()Gets the attribute map.StringgetCustomAttributeMapperClassName()Gets the classname of the CustomAttributeMapper.StringgetCustomAttributeStatementsProviderClassName()Gets the classname of the CustomAttributeStatementsProvider.StringgetCustomAuthenticationStatementsProviderClassName()Gets the classname of the CustomAuthenticationStatementsProvider.StringgetCustomAuthNContextMapperClassName()Gets the classname of the CustomAuthNContextMapper.StringgetCustomAuthzDecisionStatementsProviderClassName()Gets the classname of the CustomAuthzDecisionStatementsProvider.StringgetCustomConditionsProviderClassName()Gets the classname of the CustomConditionsProvider.StringgetCustomSubjectProviderClassName()Gets the classname of the CustomSubjectProvider.static Map<String,Set<String>>getEmptySMSAttributeState()Returns an empty attribute map.StringgetEncryptionAlgorithm()Gets the encryption algorithm.intgetEncryptionAlgorithmStrength()Gets the encryption algorithm strength.StringgetEncryptionKeyAlias()Gets the encryption key alias.StringgetIdpId()Gets the Identity Provider id.StringgetKeystoreFileName()Gets the keystore filename.byte[]getKeystorePassword()Gets the keystore password.StringgetKeyTransportAlgorithm()Gets the key transport algorithm.StringgetNameIdFormat()Gets the name-id format.StringgetSignatureKeyAlias()Gets the signature key alias.byte[]getSignatureKeyPassword()Gets the signature key password.StringgetSpAcsUrl()Gets the SP ACS url.StringgetSpEntityId()Gets the SP entity id.longgetTokenLifetimeInSeconds()Gets the token lifetime (in seconds).inthashCode()static SAML2ConfigmarshalFromAttributeMap(Map<String,Set<String>> smsAttributeMap)Marshals an attribute map into a SAML2ConfigMap<String,Set<String>>marshalToAttributeMap()Marshals the SAML2Config into an attribute mapbooleansignAssertion()Gets whether the assertion should be signed.JsonValuetoJson()Gets theJsonValuerepresentation of the SAML2Config.JsonValuetoSmsJson()Gets the SMSJsonValuerepresentation of the SAML2Config.StringtoString()
-
-
-
Method Detail
-
builder
public static SAML2Config.SAML2ConfigBuilder builder()
Creates a newSAML2ConfigBuilder.- Returns:
- a new
SAML2ConfigBuilder.
-
getNameIdFormat
public String getNameIdFormat()
Gets the name-id format.- Returns:
- the name-id format.
-
getTokenLifetimeInSeconds
public long getTokenLifetimeInSeconds()
Gets the token lifetime (in seconds).- Returns:
- the token lifetime.
-
getAttributeMap
public Map<String,String> getAttributeMap()
Gets the attribute map.- Returns:
- the attribute map.
-
getCustomConditionsProviderClassName
public String getCustomConditionsProviderClassName()
Gets the classname of the CustomConditionsProvider.- Returns:
- the classname of the CustomConditionsProvider.
-
getCustomSubjectProviderClassName
public String getCustomSubjectProviderClassName()
Gets the classname of the CustomSubjectProvider.- Returns:
- the classname of the CustomSubjectProvider.
-
getCustomAuthenticationStatementsProviderClassName
public String getCustomAuthenticationStatementsProviderClassName()
Gets the classname of the CustomAuthenticationStatementsProvider.- Returns:
- the classname of the CustomAuthenticationStatementsProvider.
-
getCustomAttributeMapperClassName
public String getCustomAttributeMapperClassName()
Gets the classname of the CustomAttributeMapper.- Returns:
- the classname of the CustomAttributeMapper.
-
getCustomAuthNContextMapperClassName
public String getCustomAuthNContextMapperClassName()
Gets the classname of the CustomAuthNContextMapper.- Returns:
- the classname of the CustomAuthNContextMapper.
-
getCustomAttributeStatementsProviderClassName
public String getCustomAttributeStatementsProviderClassName()
Gets the classname of the CustomAttributeStatementsProvider.- Returns:
- the classname of the CustomAttributeStatementsProvider.
-
getCustomAuthzDecisionStatementsProviderClassName
public String getCustomAuthzDecisionStatementsProviderClassName()
Gets the classname of the CustomAuthzDecisionStatementsProvider.- Returns:
- the classname of the CustomAuthzDecisionStatementsProvider.
-
signAssertion
public boolean signAssertion()
Gets whether the assertion should be signed.- Returns:
- whether the assertion should be signed.
-
encryptNameID
public boolean encryptNameID()
Gets whether the name-id should be encrypted.- Returns:
- whether the name-id should be encrypted.
-
encryptAttributes
public boolean encryptAttributes()
Gets whether the attributes should be encrypted.- Returns:
- whether the attributes should be encrypted.
-
encryptAssertion
public boolean encryptAssertion()
Gets whether the assertion should be encrypted.- Returns:
- whether the assertion should be encrypted.
-
getEncryptionAlgorithm
public String getEncryptionAlgorithm()
Gets the encryption algorithm.- Returns:
- the encryption algorithm.
-
getEncryptionAlgorithmStrength
public int getEncryptionAlgorithmStrength()
Gets the encryption algorithm strength.- Returns:
- the encryption algorithm strength.
-
getKeyTransportAlgorithm
public String getKeyTransportAlgorithm()
Gets the key transport algorithm.- Returns:
- The key transport algorithm.
-
getKeystoreFileName
public String getKeystoreFileName()
Gets the keystore filename.- Returns:
- the keystore filename.
-
getKeystorePassword
public byte[] getKeystorePassword()
Gets the keystore password.- Returns:
- they keystore password.
-
getSpEntityId
public String getSpEntityId()
Gets the SP entity id.- Returns:
- the SP entity id.
-
getSpAcsUrl
public String getSpAcsUrl()
Gets the SP ACS url.- Returns:
- the SP ACS url.
-
getEncryptionKeyAlias
public String getEncryptionKeyAlias()
Gets the encryption key alias.- Returns:
- the encryption key alias.
-
getSignatureKeyAlias
public String getSignatureKeyAlias()
Gets the signature key alias.- Returns:
- the signature key alias.
-
getSignatureKeyPassword
public byte[] getSignatureKeyPassword()
Gets the signature key password.- Returns:
- the signature key password.
-
getIdpId
public String getIdpId()
Gets the Identity Provider id.- Returns:
- the Identity Provider id.
-
toJson
public JsonValue toJson()
Gets theJsonValuerepresentation of the SAML2Config.- Returns:
- The
JsonValuerepresentation of the SAML2Config.
-
toSmsJson
public JsonValue toSmsJson()
Gets the SMSJsonValuerepresentation of the SAML2Config.- Returns:
- The SMS
JsonValuerepresentation of the SAML2Config.
-
fromJson
public static SAML2Config fromJson(JsonValue json) throws IllegalStateException
Creates a SAML2Config object from aJsonValuerepresentation- Parameters:
json- theJsonValuerepresentation.- Returns:
- a SAML2Config object
- Throws:
IllegalStateException- If there is an error parsing the JSON.
-
fromSmsJson
public static SAML2Config fromSmsJson(JsonValue json) throws IllegalStateException
Creates a SAML2Config object from a SMSJsonValuerepresentation- Parameters:
json- the SMSJsonValuerepresentation.- Returns:
- a SAML2Config object
- Throws:
IllegalStateException- If there is an error parsing the JSON.
-
marshalToAttributeMap
public Map<String,Set<String>> marshalToAttributeMap()
Marshals the SAML2Config into an attribute map- Returns:
- a map containing the SAML2Config attributes.
-
marshalFromAttributeMap
public static SAML2Config marshalFromAttributeMap(Map<String,Set<String>> smsAttributeMap)
Marshals an attribute map into a SAML2Config- Parameters:
smsAttributeMap- the attribute map.- Returns:
- a SAML2Config object.
-
-