@Override public void processChallenge( final AuthChallenge authChallenge, final HttpContext context) throws MalformedChallengeException { Args.notNull(authChallenge, "AuthChallenge"); if (authChallenge.getValue() == null) { throw new MalformedChallengeException("Missing auth challenge"); } challengeType = authChallenge.getChallengeType(); challenge = authChallenge.getValue(); if (challenge.isEmpty()) { if (clientCred != null) { dispose(); // run cleanup first before throwing an exception otherwise can leak OS resources if (continueNeeded) { throw new IllegalStateException("Unexpected token"); } } } }
@Override public void processChallenge( final AuthChallenge authChallenge, final HttpContext context) throws MalformedChallengeException { Args.notNull(authChallenge, "AuthChallenge"); if (authChallenge.getValue() == null) { throw new MalformedChallengeException("Missing auth challenge"); } this.challenge = authChallenge.getValue(); if (state == State.UNINITIATED) { token = Base64.decodeBase64(challenge.getBytes()); state = State.CHALLENGE_RECEIVED; } else { log.debug("Authentication already attempted"); state = State.FAILED; } }
@Override public void processChallenge( final AuthChallenge authChallenge, final HttpContext context) throws MalformedChallengeException { Args.notNull(authChallenge, "AuthChallenge"); if (authChallenge.getValue() == null) { throw new MalformedChallengeException("Missing auth challenge"); } challengeType = authChallenge.getChallengeType(); challenge = authChallenge.getValue(); if (challenge.isEmpty()) { if (clientCred != null) { dispose(); // run cleanup first before throwing an exception otherwise can leak OS resources if (continueNeeded) { throw new IllegalStateException("Unexpected token"); } } } }
@Override public void processChallenge( final AuthChallenge authChallenge, final HttpContext context) throws MalformedChallengeException { Args.notNull(authChallenge, "AuthChallenge"); if (authChallenge.getValue() == null) { throw new MalformedChallengeException("Missing auth challenge"); } this.challenge = authChallenge.getValue(); if (this.challenge == null || this.challenge.isEmpty()) { if (this.state == State.UNINITIATED) { this.state = State.CHALLENGE_RECEIVED; } else { this.state = State.FAILED; } } else { if (this.state.compareTo(State.MSG_TYPE1_GENERATED) < 0) { this.state = State.FAILED; throw new MalformedChallengeException("Out of sequence NTLM response message"); } else if (this.state == State.MSG_TYPE1_GENERATED) { this.state = State.MSG_TYPE2_RECEVIED; } } }