Package com.avoka.fc.core.security
Class SAML2AttributesParser
java.lang.Object
com.avoka.fc.core.security.SAML2AttributesParser
Provides a SAML2 (Security Assertion Markup Language) attribute parser helper class for SSO Filter authentication token scripts.
- Since:
- 4.0.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSAML2AttributesParser(jakarta.servlet.http.HttpServletRequest request) Create a SAML2 Attribute parser from the given request. -
Method Summary
Modifier and TypeMethodDescriptionReturn the SAML2 attributes from a request containing the token.booleanReturns true if the request has a SAML2 SAMLRequest or SAMLResponse request parameters.booleanDeprecated.booleanValidates the signature associated with the SAML2 Response.voidsetFromSecurityManager(SecurityManager securityManager) Set the configuration properties from the SecurityManager instead of setting individually.voidsetGroupAttributeName(String groupAttributeName) Sets the Group Attribute Name.voidsetKeystoreData(byte[] keystoreData) Sets the keystore that holds the private key and validationCertAliasvoidsetKeystorePassword(String keystorePassword) Sets the keystore passwordvoidsetPrivateKeyAlias(String privateKeyAlias) Sets the Private Key Alias for the keystorevoidsetPrivateKeyPassword(String privateKeyPassword) Sets the Private Key PasswordvoidsetValidationCertData(byte[] validatorCertData) Sets the certificate used for validating the SAML2 Signature
-
Field Details
-
REQUEST_PARAM_SAML_RESPONSE
Request param SAMLResponse- See Also:
-
-
Constructor Details
-
SAML2AttributesParser
public SAML2AttributesParser(jakarta.servlet.http.HttpServletRequest request) Create a SAML2 Attribute parser from the given request.- Parameters:
request- - HttpServletRequest that contains the SAML Token (required)
-
-
Method Details
-
getSSOAuthenticationToken
Return the SAML2 attributes from a request containing the token. The map has 2 types of entries:- simple attributes like givenname are stored in the Map as String
- attributes such as groups are stored in the Map as List
SSOAuthenticationTokenwill any parsed groups as SpringGrantedAuthoritys.- Returns:
- the ssoAuthenticationToken which contain a ssoAuthTokenAttributeMap
-
isValidSignature
public boolean isValidSignature()Validates the signature associated with the SAML2 Response. Note this does not check the signature of the assertions.- Returns:
- false if the SAML token is invalid, true if Valid or if the certPublicKey is not specified.
-
isValidSignatue
public boolean isValidSignatue()Deprecated.Validates the SAML2 Response.- Returns:
- false if the SAML token is invalid, true if Valid or if the certPublicKey is not specified.
-
setFromSecurityManager
Set the configuration properties from the SecurityManager instead of setting individually.- Parameters:
securityManager- the security manager associated with this SSO (required)
-
setValidationCertData
public void setValidationCertData(byte[] validatorCertData) Sets the certificate used for validating the SAML2 Signature- Parameters:
validatorCertData- byte[]
-
setKeystoreData
public void setKeystoreData(byte[] keystoreData) Sets the keystore that holds the private key and validationCertAlias- Parameters:
keystoreData- byte[]
-
setKeystorePassword
Sets the keystore password- Parameters:
keystorePassword- String
-
setPrivateKeyAlias
Sets the Private Key Alias for the keystore- Parameters:
privateKeyAlias- String
-
setPrivateKeyPassword
Sets the Private Key Password- Parameters:
privateKeyPassword- String
-
setGroupAttributeName
Sets the Group Attribute Name. If the SAML2 attribute parser has groupAttributeName configured then theSSOAuthenticationTokenwill any parsed groups as SpringGrantedAuthoritys.- Parameters:
groupAttributeName- String
-
hasSamlToken
public boolean hasSamlToken()Returns true if the request has a SAML2 SAMLRequest or SAMLResponse request parameters.- Returns:
- true if has a SAMLRequest or SAMLResponse request parameter
-