Package org.apache.commons.httpclient.auth

Examples of org.apache.commons.httpclient.auth.MalformedChallengeException


    {
        String s = AuthChallengeParser.extractScheme(challenge);

        if (!s.equalsIgnoreCase(getSchemeName()))
        {
            throw new MalformedChallengeException("Invalid NTLM challenge: " + challenge);
        }

        int i = challenge.indexOf(' ');

        if (i != -1)
View Full Code Here


    {
        String s = AuthChallengeParser.extractScheme(challenge);

        if (!s.equalsIgnoreCase(getSchemeName()))
        {
            throw new MalformedChallengeException("Invalid NTLM challenge: " + challenge);
        }

        int i = challenge.indexOf(' ');

        if (i != -1)
View Full Code Here

     * @param challenge the challenge string
     * @since 3.0
     */
    public void processChallenge(final String challenge) throws MalformedChallengeException {
        if (challenge == null) {
            throw new MalformedChallengeException("Null challenge");
        }
        String[] tokens = challenge.trim().split("\\s+");
        if (!tokens[0].equalsIgnoreCase(CHALLENGE)) {
            LOGGER.log(Level.WARNING, "Received malformed challenge: \"{0}\"", challenge);
            throw new MalformedChallengeException(challenge);
        }
        switch (tokens.length) {
            case 1:
                LOGGER.log(Level.INFO, "Received initial \"{0}\" challenge", CHALLENGE);
                serverToken = new byte[0];
                break;
            case 2:
                LOGGER.log(Level.INFO, "Received \"{0}\" challenge with token \"{1}\"", new String[]{CHALLENGE, tokens[1]});
                serverToken = BASE64_CODEC.decode(tokens[1].getBytes());
                break;
            default:
                LOGGER.log(Level.WARNING, "Received malformed challenge: \"{0}\"", challenge);
                throw new MalformedChallengeException();
        }
    }
View Full Code Here

        if (method.getStatusCode() == HttpStatus.SC_FORBIDDEN) {
            claims.originalUri = method.getURI();
            method.setRequestHeader(new Header("User-Agent", "Mozilla/4.0"));
            Header xforms = method.getResponseHeader("X-Forms_Based_Auth_Required");
            if (xforms == null) {
                throw new MalformedChallengeException("Status 403 Forbidden received from" +
                    "server, but X-Forms_Based_Auth_Required header missing - not claims " +
                    "based authentication");
            }
            URI xform = new URI(xforms.getValue().split(", ")[0]);
            hostConfiguration.setHost(xform);
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.auth.MalformedChallengeException

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.