A Java utility built on OpenSAML3 libraries to generate SAML objects such as Response and Assertion.
Learn about Prerequisites (Certificate, PrivateKey, Java KeyStore etc.) of this utility at opensaml3-utils-usage or saml-assertion-generation.
Run the following commands in your developer machine, assuming Git and Maven have been installed and configured.
- git clone https://github.com/MatthewWilliamsNW/opensaml3-utils
- cd opensaml3-utils
- mvn clean
- mvn install
Run either one of the following to see the output.
- With default inputs, Run main() method of "OpenSaml3AssertionAppTest.java" class. A Test certificate and a JKS is shipped with test suite.
- With custom inputs, invoke Map<String, String> buildSAMLAssertionObjects(String jksFilePath, String jksKeystorePassword, String keyPassword, String certAlias, String issuerID, String entityID, String audienceRestrictionURL, String samlAuthType, int assertionTimeoutInMin) on the instance of OpenSaml3AssertionApplication.
- With custom inputs, invoke Map<String, String> buildSAMLAssertionObjects(File jksFile, String jksKeystorePassword, String keyPassword, String certAlias, String issuerID, String entityID, String audienceRestrictionURL, String samlAuthType, int assertionTimeoutInMin) on the instance of OpenSaml3AssertionApplication
A Java.util.Map is returned with following four key-value pairs.
- SAML_RESPONSE = A xml-string representation of SAMLResponse.
- SAML_ASSERTION = A xml-string representation of SAMLAssertion extracted from value of "SAML_RESPONSE" object.
- SAML_ASSERTION_BASE64_ENCODED = A Base64 Encoded value of "SAML_ASSERTION" object.
- SAML_ASSERTION_URLENCODED_BASE64 = A URL Encoded value of "SAML_ASSERTION_BASE64_ENCODED" object.
Note: The most desired Base64Encoded of Saml:Assertion/ is associated with "SAML_ASSERTION_BASE64_ENCODED" key in the map.
mvn deploy:deploy-file -DgroupId=com.nationwide -DartifactId=opensaml3-utils -Dversion=0.0.1 -Dpackaging=jar -Dfile=opensaml3-utils-0.0.1.jar -DrepositoryId=releases -Durl=your repo
mvn deploy