|
9 | 9 |
|
10 | 10 | import javax.xml.xpath.XPathExpressionException; |
11 | 11 |
|
12 | | -import com.onelogin.saml2.model.SubjectConfirmationIssue; |
13 | 12 | import org.apache.commons.lang3.ObjectUtils; |
14 | 13 | import org.joda.time.DateTime; |
15 | 14 | import org.slf4j.Logger; |
|
20 | 19 | import org.w3c.dom.Node; |
21 | 20 | import org.w3c.dom.NodeList; |
22 | 21 |
|
23 | | -import com.onelogin.saml2.settings.Saml2Settings; |
| 22 | +import com.onelogin.saml2.http.HttpRequest; |
24 | 23 | import com.onelogin.saml2.model.SamlResponseStatus; |
| 24 | +import com.onelogin.saml2.model.SubjectConfirmationIssue; |
| 25 | +import com.onelogin.saml2.settings.Saml2Settings; |
25 | 26 | import com.onelogin.saml2.util.Constants; |
26 | 27 | import com.onelogin.saml2.util.SchemaFactory; |
27 | 28 | import com.onelogin.saml2.util.Util; |
@@ -79,19 +80,17 @@ public class SamlResponse { |
79 | 80 | * |
80 | 81 | * @param settings |
81 | 82 | * Saml2Settings object. Setting data |
82 | | - * @param requestURL |
83 | | - * the URL where the response was POST'ed (not including query parameters) |
84 | | - * @param samlResponseParameter |
85 | | - * the contents of the {@code SAMLResponse} query parameter |
| 83 | + * @param request |
| 84 | + * the HttpRequest object to be processed (Contains GET and POST parameters, request URL, ...). |
86 | 85 | * |
87 | | - * @throws Exception |
| 86 | + * @throws Exception |
88 | 87 | */ |
89 | | - public SamlResponse(Saml2Settings settings, String requestURL, String samlResponseParameter) throws Exception { |
| 88 | + public SamlResponse(Saml2Settings settings, HttpRequest request) throws Exception { |
90 | 89 | this.settings = settings; |
91 | 90 |
|
92 | | - if (requestURL != null && samlResponseParameter != null) { |
93 | | - currentUrl = requestURL; |
94 | | - loadXmlFromBase64(samlResponseParameter); |
| 91 | + if (request != null) { |
| 92 | + currentUrl = request.getRequestURL(); |
| 93 | + loadXmlFromBase64(request.getParameter("SAMLResponse")); |
95 | 94 | } |
96 | 95 | } |
97 | 96 |
|
|
0 commit comments