returnUrlBuilder.getQueryParams().add(new Pair<String, String>(entry.getKey(), entry.getValue()));
returnUrlBuilder.getQueryParams().add(new Pair<String, String>(entry.getKey(), entry.getValue()));
return new Pair<PublicKey, X509Certificate>(presenterKey, presenterCert);
/** * Creates a URL to be used for returning of the selected IDP and sends a redirect. * * @param request request object * @param response response object * @param responseURL base for the return URL * @param returnParam parameter name to send the IDP entityId in * @param entityID entity ID to send or null for fail state * @throws IOException in case redirect sending fails * @throws ServletException in case redirect sending fails */ protected void sendPassiveResponse(HttpServletRequest request, HttpServletResponse response, String responseURL, String returnParam, String entityID) throws IOException, ServletException { String finalResponseURL = responseURL; if (entityID != null) { URLBuilder urlBuilder = new URLBuilder(responseURL); List<Pair<String, String>> queryParams = urlBuilder.getQueryParams(); queryParams.add(new Pair<String, String>(returnParam, entityID)); finalResponseURL = urlBuilder.buildURL(); } log.debug("Responding to a passive IDP Discovery request with URL {}", finalResponseURL); response.sendRedirect(finalResponseURL); }
/** * Resolve and return a set of trusted validation information. * * @param trustBasisCriteria criteria used to describe and/or resolve the information which serves as the basis for * trust evaluation * @return a pair consisting of an optional set of trusted names, and an iterable of trusted * PKIXValidationInformation * @throws SecurityException thrown if there is an error resolving the information from the trusted resolver */ protected Pair<Set<String>, Iterable<PKIXValidationInformation>> resolveValidationInfo( CriteriaSet trustBasisCriteria) throws SecurityException { Set<String> trustedNames = null; if (pkixResolver.supportsTrustedNameResolution()) { trustedNames = pkixResolver.resolveTrustedNames(trustBasisCriteria); } else { log.debug("PKIX resolver does not support resolution of trusted names, skipping name checking"); } Iterable<PKIXValidationInformation> validationInfoSet = pkixResolver.resolve(trustBasisCriteria); Pair<Set<String>, Iterable<PKIXValidationInformation>> validationPair = new Pair<Set<String>, Iterable<PKIXValidationInformation>>(trustedNames, validationInfoSet); return validationPair; }
/** * Resolve and return a set of trusted validation information. * * @param trustBasisCriteria criteria used to describe and/or resolve the information which serves as the basis for * trust evaluation * @return a pair consisting of an optional set of trusted names, and an iterable of trusted * PKIXValidationInformation * @throws SecurityException thrown if there is an error resolving the information from the trusted resolver */ protected Pair<Set<String>, Iterable<PKIXValidationInformation>> resolveValidationInfo( CriteriaSet trustBasisCriteria) throws SecurityException { Set<String> trustedNames = null; if (pkixResolver.supportsTrustedNameResolution()) { trustedNames = pkixResolver.resolveTrustedNames(trustBasisCriteria); } else { log.debug("PKIX resolver does not support resolution of trusted names, skipping name checking"); } Iterable<PKIXValidationInformation> validationInfoSet = pkixResolver.resolve(trustBasisCriteria); Pair<Set<String>, Iterable<PKIXValidationInformation>> validationPair = new Pair<Set<String>, Iterable<PKIXValidationInformation>>(trustedNames, validationInfoSet); return validationPair; }
queryParams.add(new Pair<String, String>("SAMLRequest", message)); } else if (messagesContext.getOutboundSAMLMessage() instanceof StatusResponseType) { queryParams.add(new Pair<String, String>("SAMLResponse", message)); } else { throw new MessageEncodingException( queryParams.add(new Pair<String, String>("RelayState", relayState)); Pair<String, String> sigAlg = new Pair<String, String>("SigAlg", sigAlgURI); queryParams.add(sigAlg); String sigMaterial = urlBuilder.buildQueryString(); queryParams.add(new Pair<String, String>("Signature", generateSignature(signingCredential, sigAlgURI, sigMaterial)));
Pair<String, String> pair = new Pair<String, String>(attributeName, attributeNameFormat); if (encounteredNames.contains(pair)) { throw new ValidationException(
/** * Performs HTTP GET based encoding. * * @param artifactContext current request context * @param outTransport outbound HTTP transport * * @throws MessageEncodingException thrown if there is a problem GET encoding the artifact */ protected void getEncode(SAMLMessageContext artifactContext, HTTPOutTransport outTransport) throws MessageEncodingException { log.debug("Performing HTTP GET SAML 2 artifact encoding"); URLBuilder urlBuilder = getEndpointURL(artifactContext); List<Pair<String, String>> params = urlBuilder.getQueryParams(); AbstractSAMLArtifact artifact = buildArtifact(artifactContext); if(artifact == null){ log.error("Unable to build artifact for message to relying party"); throw new MessageEncodingException("Unable to builder artifact for message to relying party"); } params.add(new Pair<String, String>("SAMLart", artifact.base64Encode())); if (checkRelayState(artifactContext.getRelayState())) { params.add(new Pair<String, String>("RelayState", artifactContext.getRelayState())); } outTransport.sendRedirect(urlBuilder.buildURL()); }
if (!queryComp.contains("=")) { paramName = HTTPTransportUtils.urlDecode(queryComp); queryParams.add(new Pair<String, String>(paramName, null)); } else { paramComps = queryComp.split("="); paramName = HTTPTransportUtils.urlDecode(paramComps[0]); paramValue = HTTPTransportUtils.urlDecode(paramComps[1]); queryParams.add(new Pair<String, String>(paramName, paramValue));