Package org.jasig.cas.authentication.principal

Examples of org.jasig.cas.authentication.principal.HttpBasedServiceCredentials


    @NotNull
    private HttpClient httpClient;

    public String handle(final Credentials credentials,
        final String proxyGrantingTicketId) {
        final HttpBasedServiceCredentials serviceCredentials = (HttpBasedServiceCredentials) credentials;
        final String proxyIou = this.uniqueTicketIdGenerator
            .getNewTicketId(PGTIOU_PREFIX);
        final String serviceCredentialsAsString = serviceCredentials.getCallbackUrl().toExternalForm();
        final StringBuilder stringBuffer = new StringBuilder(
            serviceCredentialsAsString.length() + proxyIou.length()
                + proxyGrantingTicketId.length() + 15);

        stringBuffer.append(serviceCredentialsAsString);

        if (serviceCredentials.getCallbackUrl().getQuery() != null) {
            stringBuffer.append("&");
        } else {
            stringBuffer.append("?");
        }

        stringBuffer.append("pgtIou=");
        stringBuffer.append(proxyIou);
        stringBuffer.append("&pgtId=");
        stringBuffer.append(proxyGrantingTicketId);

        if (this.httpClient.isValidEndPoint(stringBuffer.toString())) {
            if (log.isDebugEnabled()) {
                log.debug("Sent ProxyIou of " + proxyIou + " for service: "
                    + serviceCredentials.toString());
            }
            return proxyIou;
        }

        if (log.isDebugEnabled()) {
            log.debug("Failed to send ProxyIou of " + proxyIou
                + " for service: " + serviceCredentials.toString());
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.jasig.cas.authentication.principal.HttpBasedServiceCredentials

Copyright © 2018 www.massapicom. 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.