/** * Validates that the response is a success. * * @param status the response status. */ protected final void validateSuccess(final Status status) { String statusValue = status.getStatusCode().getValue(); if (!StatusCode.SUCCESS.equals(statusValue)) { final StatusMessage statusMessage = status.getStatusMessage(); if (statusMessage != null) { statusValue += " / " + statusMessage.getMessage(); } throw new SAMLException("Response is not success ; actual " + statusValue); } }
protected Status getStatus(org.opensaml.saml.saml2.core.Status status) { return new Status() .setCode(StatusCode.fromUrn(status.getStatusCode().getValue())) .setMessage(status.getStatusMessage() != null ? status.getStatusMessage().getMessage() : null); }
/** {@inheritDoc} */ @Override @Nullable public String apply(@Nullable final ProfileRequestContext input) { final SAMLObject response = responseLookupStrategy.apply(input); if (response != null) { if (response instanceof Response) { final org.opensaml.saml.saml1.core.StatusMessage msg = ((Response) response).getStatus() != null ? ((Response) response).getStatus().getStatusMessage() : null; if (msg != null) { return msg.getMessage(); } } else if (response instanceof StatusResponseType) { final org.opensaml.saml.saml2.core.StatusMessage msg = ((StatusResponseType) response).getStatus() != null ? ((StatusResponseType) response).getStatus().getStatusMessage() : null; if (msg != null) { return msg.getMessage(); } } } return null; }
} else { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.Unknown); if (logoutResponse.getStatus().getStatusMessage() == null) { sce.getElements().add(logoutResponse.getStatus().getStatusCode().getValue()); } else { sce.getElements().add(logoutResponse.getStatus().getStatusMessage().getMessage());