if (authnRequest.getDestination() != null && idPUrl.equals(authnRequest.getDestination())) { validatedItems.add(new ValidatedItemDTO( SAMLValidatorConstants.ValidationType.VAL_DESTINATION, true, String.format(SAMLValidatorConstants.ValidationMessage.VAL_DESTINATION_SUCCESS, authnRequest.getDestination()))); } else { validatedItems.add(new ValidatedItemDTO( false, String.format(SAMLValidatorConstants.ValidationMessage.VAL_DESTINATION_FAIL, authnRequest.getDestination(), idPUrl))); throw IdentityException.error(
if (authnRequest.getDestination() != null && idPUrl.equals(authnRequest.getDestination())) { validatedItems.add(new ValidatedItemDTO( SAMLValidatorConstants.ValidationType.VAL_DESTINATION, true, String.format(SAMLValidatorConstants.ValidationMessage.VAL_DESTINATION_SUCCESS, authnRequest.getDestination()))); } else { validatedItems.add(new ValidatedItemDTO( false, String.format(SAMLValidatorConstants.ValidationMessage.VAL_DESTINATION_FAIL, authnRequest.getDestination(), idPUrl))); throw IdentityException.error(
if (authnReq.getDestination() == null || !idpUrlSet.contains(authnReq.getDestination())) { String msg = "Destination validation for AuthnRequest failed. " + "Received: [" + saml2SSOContext.getDestination() + "]." + " Expected one in the list: [" + StringUtils throw ex; saml2SSOContext.setDestination(authnReq.getDestination());
validationResponse.setDestination(authnReq.getDestination()); validationResponse.setValid(true); validationResponse.setPassive(authnReq.isPassive());
messageContext.setDestination(((AuthnRequest) request).getDestination()); messageContext.setId(((AuthnRequest) request).getID()); messageContext.setAssertionConsumerUrl(((AuthnRequest) request).getAssertionConsumerServiceURL());
public static boolean validateAuthnRequestSignature(AuthnRequest authnRequest, SAML2SSOContext saml2SSOContext, RequestValidatorConfig config) throws SAML2SSORequestValidationException, SAML2SSOServerException { String encodedCert = config.getSigningCertificate(); X509Certificate certificate; try { certificate = (X509Certificate) Utils.decodeCertificate(encodedCert); } catch (CertificateException e) { SAML2SSOServerException ex = new SAML2SSOServerException(StatusCode.RESPONDER_URI, "Error occurred while decoding signing certificate.", e); ex.setInResponseTo(authnRequest.getID()); ex.setAcsUrl(authnRequest.getDestination()); throw ex; } SPInitRequest spInitRequest = ((SPInitRequest) saml2SSOContext.getRequest()); if (spInitRequest.isRedirect()) { return validateDeflateSignature(spInitRequest.getQueryString(), spInitRequest.getSignature(), spInitRequest.getSignatureAlgorithm(), certificate, saml2SSOContext.getId(), saml2SSOContext.getAssertionConsumerURL(), saml2SSOContext.getSPEntityId()); } else { return validateXMLSignature(authnRequest, certificate, saml2SSOContext.getId(), saml2SSOContext.getAssertionConsumerURL()); } }