/** * Extracts a map of challenges ordered by authentication scheme name * * @param headers the array of authorization challenges * @return a map of authorization challenges * * @throws MalformedChallengeException if any of challenge strings * is malformed * * @since 3.0 */ public static Map parseChallenges(final Header[] headers) throws MalformedChallengeException { if (headers == null) { throw new IllegalArgumentException("Array of challenges may not be null"); } String challenge = null; Map challengemap = new HashMap(headers.length); for (int i = 0; i < headers.length; i++) { challenge = headers[i].getValue(); String s = AuthChallengeParser.extractScheme(challenge); challengemap.put(s, challenge); } return challengemap; } }
/** * Processes the given challenge token. Some authentication schemes * may involve multiple challenge-response exchanges. Such schemes must be able * to maintain the state information when dealing with sequential challenges * * @param challenge the challenge string * * @throws MalformedChallengeException is thrown if the authentication challenge * is malformed * * @since 3.0 */ public void processChallenge(final String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException( "Invalid " + getSchemeName() + " challenge: " + challenge); } this.params = AuthChallengeParser.extractParams(challenge); }
Map proxyChallenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(PROXY_AUTH_CHALLENGE)); if (proxyChallenges.isEmpty()) {
/** * Processes the NTLM challenge. * * @param challenge the challenge string * * @throws MalformedChallengeException is thrown if the authentication challenge * is malformed * * @since 3.0 */ public void processChallenge(final String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException("Invalid NTLM challenge: " + challenge); } int i = challenge.indexOf(' '); if (i != -1) { s = challenge.substring(i, challenge.length()); this.ntlmchallenge = s.trim(); this.state = TYPE2_MSG_RECEIVED; } else { this.ntlmchallenge = ""; if (this.state == UNINITIATED) { this.state = INITIATED; } else { this.state = FAILED; } } }
/** * Processes the Bearer challenge. * * @param challenge The challenge string * * @throws MalformedChallengeException Thrown if the authentication challenge is malformed */ public void processChallenge(String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException( "Invalid " + getSchemeName() + " challenge: " + challenge); } mParams = AuthChallengeParser.extractParams(challenge); mComplete = true; }
Map challenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(WWW_AUTH_CHALLENGE)); if (challenges.isEmpty()) {
for (int i = 0; i < challenges.length; i++) { challenge = challenges[i].getValue(); String s = AuthChallengeParser.extractScheme(challenge); challengemap.put(s, challenge);
/** * Processes the given challenge token. Some authentication schemes * may involve multiple challenge-response exchanges. Such schemes must be able * to maintain the state information when dealing with sequential challenges * * @param challenge the challenge string * * @throws MalformedChallengeException is thrown if the authentication challenge * is malformed * * @since 3.0 */ public void processChallenge(final String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException( "Invalid " + getSchemeName() + " challenge: " + challenge); } this.params = AuthChallengeParser.extractParams(challenge); }
Map proxyChallenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(PROXY_AUTH_CHALLENGE)); if (proxyChallenges.isEmpty()) {
/** * Extracts a map of challenges ordered by authentication scheme name * * @param headers the array of authorization challenges * @return a map of authorization challenges * * @throws MalformedChallengeException if any of challenge strings * is malformed * * @since 3.0 */ public static Map parseChallenges(final Header[] headers) throws MalformedChallengeException { if (headers == null) { throw new IllegalArgumentException("Array of challenges may not be null"); } String challenge = null; Map challengemap = new HashMap(headers.length); for (int i = 0; i < headers.length; i++) { challenge = headers[i].getValue(); String s = AuthChallengeParser.extractScheme(challenge); challengemap.put(s, challenge); } return challengemap; } }
/** * Processes the given challenge token. Some authentication schemes * may involve multiple challenge-response exchanges. Such schemes must be able * to maintain the state information when dealing with sequential challenges * * @param challenge the challenge string * * @throws MalformedChallengeException is thrown if the authentication challenge * is malformed * * @since 3.0 */ public void processChallenge(final String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException( "Invalid " + getSchemeName() + " challenge: " + challenge); } this.params = AuthChallengeParser.extractParams(challenge); }
Map proxyChallenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(PROXY_AUTH_CHALLENGE)); if (proxyChallenges.isEmpty()) {
/** * Extracts a map of challenges ordered by authentication scheme name * * @param headers the array of authorization challenges * @return a map of authorization challenges * * @throws MalformedChallengeException if any of challenge strings * is malformed * * @since 3.0 */ public static Map parseChallenges(final Header[] headers) throws MalformedChallengeException { if (headers == null) { throw new IllegalArgumentException("Array of challenges may not be null"); } String challenge = null; Map challengemap = new HashMap(headers.length); for (int i = 0; i < headers.length; i++) { challenge = headers[i].getValue(); String s = AuthChallengeParser.extractScheme(challenge); challengemap.put(s, challenge); } return challengemap; } }
/** * Processes the given challenge token. Some authentication schemes * may involve multiple challenge-response exchanges. Such schemes must be able * to maintain the state information when dealing with sequential challenges * * @param challenge the challenge string * * @throws MalformedChallengeException is thrown if the authentication challenge * is malformed * * @since 3.0 */ public void processChallenge(final String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException( "Invalid " + getSchemeName() + " challenge: " + challenge); } this.params = AuthChallengeParser.extractParams(challenge); }
Map proxyChallenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(PROXY_AUTH_CHALLENGE)); if (proxyChallenges.isEmpty()) {
/** * Extracts a map of challenges ordered by authentication scheme name * * @param headers the array of authorization challenges * @return a map of authorization challenges * * @throws MalformedChallengeException if any of challenge strings * is malformed * * @since 3.0 */ public static Map parseChallenges(final Header[] headers) throws MalformedChallengeException { if (headers == null) { throw new IllegalArgumentException("Array of challenges may not be null"); } String challenge = null; Map challengemap = new HashMap(headers.length); for (int i = 0; i < headers.length; i++) { challenge = headers[i].getValue(); String s = AuthChallengeParser.extractScheme(challenge); challengemap.put(s, challenge); } return challengemap; } }
/** * Processes the given challenge token. Some authentication schemes * may involve multiple challenge-response exchanges. Such schemes must be able * to maintain the state information when dealing with sequential challenges * * @param challenge the challenge string * * @throws MalformedChallengeException is thrown if the authentication challenge * is malformed * * @since 3.0 */ public void processChallenge(final String challenge) throws MalformedChallengeException { String s = AuthChallengeParser.extractScheme(challenge); if (!s.equalsIgnoreCase(getSchemeName())) { throw new MalformedChallengeException( "Invalid " + getSchemeName() + " challenge: " + challenge); } this.params = AuthChallengeParser.extractParams(challenge); }
Map proxyChallenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(PROXY_AUTH_CHALLENGE)); if (proxyChallenges.isEmpty()) {
/** * Extracts a map of challenges ordered by authentication scheme name * * @param headers the array of authorization challenges * @return a map of authorization challenges * * @throws MalformedChallengeException if any of challenge strings * is malformed * * @since 3.0 */ public static Map parseChallenges(final Header[] headers) throws MalformedChallengeException { if (headers == null) { throw new IllegalArgumentException("Array of challenges may not be null"); } String challenge = null; Map challengemap = new HashMap(headers.length); for (int i = 0; i < headers.length; i++) { challenge = headers[i].getValue(); String s = AuthChallengeParser.extractScheme(challenge); challengemap.put(s, challenge); } return challengemap; } }
Map<?, ?> proxyChallenges = AuthChallengeParser.parseChallenges( method.getResponseHeaders(PROXY_AUTH_CHALLENGE)); if (proxyChallenges.isEmpty()) {