Examples of encodeForHTMLAttribute()


Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

        try {
            VelocityContext context = new VelocityContext();
            Encoder esapiEncoder = ESAPI.encoder();

            String encodedEndpointURL = esapiEncoder.encodeForHTMLAttribute(endpointURL);
            log.debug("Encoding action url of '{}' with encoded value '{}'", endpointURL, encodedEndpointURL);
            context.put("action", encodedEndpointURL);
            context.put("binding", getBindingURI());

            log.debug("Marshalling and Base64 encoding SAML message");
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

            String messageXML = XMLHelper.nodeToString(marshallMessage(messageContext.getOutboundSAMLMessage()));
            String encodedMessage = Base64.encodeBytes(messageXML.getBytes("UTF-8"), Base64.DONT_BREAK_LINES);
            context.put("SAMLResponse", encodedMessage);

            if (messageContext.getRelayState() != null) {
                String encodedRelayState = esapiEncoder.encodeForHTMLAttribute(messageContext.getRelayState());
                log.debug("Setting TARGET parameter to: '{}', encoded as '{}'", messageContext.getRelayState(), encodedRelayState);
                context.put("TARGET", encodedRelayState);
            }

            HTTPOutTransport outTransport = (HTTPOutTransport) messageContext.getOutboundMessageTransport();
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

        log.debug("Creating velocity context");
        VelocityContext context = new VelocityContext();
        Encoder esapiEncoder = ESAPI.encoder();
        String endpointURL = getEndpointURL(artifactContext).toString();
        String encodedEndpointURL = esapiEncoder.encodeForHTMLAttribute(endpointURL);
        log.debug("Setting action parameter to: '{}', encoded as '{}'", endpointURL, encodedEndpointURL);
        context.put("action", encodedEndpointURL);
        context.put("SAMLArt", buildArtifact(artifactContext).base64Encode());
        context.put("binding", getBindingURI());
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

        context.put("action", encodedEndpointURL);
        context.put("SAMLArt", buildArtifact(artifactContext).base64Encode());
        context.put("binding", getBindingURI());

        if (checkRelayState(artifactContext.getRelayState())) {
            String encodedRelayState = esapiEncoder.encodeForHTMLAttribute(artifactContext.getRelayState());
            log.debug("Setting RelayState parameter to: '{}', encoded as '{}'", artifactContext.getRelayState(), encodedRelayState);
            context.put("RelayState", encodedRelayState);
        }

        try {
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

    protected void populateVelocityContext(VelocityContext velocityContext, SAMLMessageContext messageContext,
            String endpointURL) throws MessageEncodingException {
       
        Encoder esapiEncoder = ESAPI.encoder();

        String encodedEndpointURL = esapiEncoder.encodeForHTMLAttribute(endpointURL);
        log.debug("Encoding action url of '{}' with encoded value '{}'", endpointURL, encodedEndpointURL);
        velocityContext.put("action", encodedEndpointURL);
        velocityContext.put("binding", getBindingURI());

        log.debug("Marshalling and Base64 encoding SAML message");
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

            throw new MessageEncodingException("Unable to encode message, UTF-8 encoding is not supported");
        }

        String relayState = messageContext.getRelayState();
        if (checkRelayState(relayState)) {
            String encodedRelayState = esapiEncoder.encodeForHTMLAttribute(relayState);
            log.debug("Setting RelayState parameter to: '{}', encoded as '{}'", relayState, encodedRelayState);
            velocityContext.put("RelayState", encodedRelayState);
        }
    }
}
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

        try {
            VelocityContext context = new VelocityContext();
            Encoder esapiEncoder = ESAPI.encoder();

            String encodedEndpointURL = esapiEncoder.encodeForHTMLAttribute(endpointURL);
            log.debug("Encoding action url of '{}' with encoded value '{}'", endpointURL, encodedEndpointURL);
            context.put("action", encodedEndpointURL);

            log.debug("Marshalling and Base64 encoding SAML message");
            String messageXML = XMLHelper.nodeToString(marshallMessage(messageContext.getOutboundSAMLMessage()));
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

            String messageXML = XMLHelper.nodeToString(marshallMessage(messageContext.getOutboundSAMLMessage()));
            String encodedMessage = Base64.encodeBytes(messageXML.getBytes("UTF-8"), Base64.DONT_BREAK_LINES);
            context.put("SAMLResponse", encodedMessage);

            if (messageContext.getRelayState() != null) {
                String encodedRelayState = esapiEncoder.encodeForHTMLAttribute(messageContext.getRelayState());
                log.debug("Setting TARGET parameter to: '{}', encoded as '{}'", messageContext.getRelayState(), encodedRelayState);
                context.put("TARGET", encodedRelayState);
            }

            HTTPOutTransport outTransport = (HTTPOutTransport) messageContext.getOutboundMessageTransport();
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

        log.debug("Creating velocity context");
        VelocityContext context = new VelocityContext();
        Encoder esapiEncoder = ESAPI.encoder();
        String endpointURL = getEndpointURL(artifactContext).toString();
        String encodedEndpointURL = esapiEncoder.encodeForHTMLAttribute(endpointURL);
        log.debug("Setting action parameter to: '{}', encoded as '{}'", endpointURL, encodedEndpointURL);
        context.put("action", encodedEndpointURL);
        context.put("SAMLArt", buildArtifact(artifactContext).base64Encode());

        if (checkRelayState(artifactContext.getRelayState())) {
View Full Code Here

Examples of org.owasp.esapi.Encoder.encodeForHTMLAttribute()

        log.debug("Setting action parameter to: '{}', encoded as '{}'", endpointURL, encodedEndpointURL);
        context.put("action", encodedEndpointURL);
        context.put("SAMLArt", buildArtifact(artifactContext).base64Encode());

        if (checkRelayState(artifactContext.getRelayState())) {
            String encodedRelayState = esapiEncoder.encodeForHTMLAttribute(artifactContext.getRelayState());
            log.debug("Setting RelayState parameter to: '{}', encoded as '{}'", artifactContext.getRelayState(), encodedRelayState);
            context.put("RelayState", encodedRelayState);
        }

        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.