parse out soap headers
This commit is contained in:
Scott Battaglia 2008-03-03 17:06:51 +00:00
parent ccbf08d8aa
commit a9f0ed72e6
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,9 @@ public final class Saml11TicketValidator extends AbstractUrlBasedTicketValidator
protected Assertion parseResponseFromServer(final String response) throws TicketValidationException {
try {
final SAMLResponse samlResponse = new SAMLResponse(new ByteArrayInputStream(response.getBytes()));
final String removeStartOfSoapBody = response.substring(response.indexOf("<SOAP-ENV:Body>") + 15);
final String removeEndOfSoapBody = removeStartOfSoapBody.substring(0, removeStartOfSoapBody.indexOf("</SOAP-ENV:Body>"));
final SAMLResponse samlResponse = new SAMLResponse(new ByteArrayInputStream(removeEndOfSoapBody.getBytes()));
if (!samlResponse.getAssertions().hasNext()) {
throw new TicketValidationException("No assertions found.");