@@ -81,6 +81,32 @@ public class SamlResponse {
8181 */
8282 private Exception validationException ;
8383
84+ /**
85+ * Constructor to have a Response object fully built and ready to validate the saml response.
86+ *
87+ * @param settings
88+ * Saml2Settings object. Setting data
89+ * @param currentUrl
90+ * URL of the current host + current view
91+ *
92+ * @param samlResponse
93+ * A string containting the base64 encoded response from the IdP
94+ *
95+ *
96+ * @throws ValidationError
97+ * @throws SettingsException
98+ * @throws IOException
99+ * @throws SAXException
100+ * @throws ParserConfigurationException
101+ * @throws XPathExpressionException
102+ *
103+ */
104+ public SamlResponse (Saml2Settings settings , String currentUrl , String samlResponse ) throws XPathExpressionException , ParserConfigurationException , SAXException , IOException , SettingsException , ValidationError {
105+ this .settings = settings ;
106+ this .currentUrl = currentUrl ;
107+ loadXmlFromBase64 (samlResponse );
108+ }
109+
84110 /**
85111 * Constructor to have a Response object fully built and ready to validate the saml response.
86112 *
@@ -98,12 +124,7 @@ public class SamlResponse {
98124 *
99125 */
100126 public SamlResponse (Saml2Settings settings , HttpRequest request ) throws XPathExpressionException , ParserConfigurationException , SAXException , IOException , SettingsException , ValidationError {
101- this .settings = settings ;
102-
103- if (request != null ) {
104- currentUrl = request .getRequestURL ();
105- loadXmlFromBase64 (request .getParameter ("SAMLResponse" ));
106- }
127+ this (settings , request .getRequestURL (), request .getParameter ("SAMLResponse" ));
107128 }
108129
109130 /**
0 commit comments