Package org.apache.commons.httpclient.auth

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


      GoogleLoginAuthCredentials gcreds =
        (GoogleLoginAuthCredentials) credentials;
      service = gcreds.getService();
      auth = gcreds.getAuth();
    } else {
      throw new AuthenticationException(
      "Cannot use credentials for GoogleLogin authentication");
    }
    StringBuffer buf = new StringBuffer("GoogleLogin ");
    buf.append(auth);
    return buf.toString();
View Full Code Here


      GoogleLoginAuthCredentials gcreds =
        (GoogleLoginAuthCredentials) credentials;
      service = gcreds.getService();
      auth = gcreds.getAuth();
    } else {
      throw new AuthenticationException(
      "Cannot use credentials for GoogleLogin authentication");
    }
    StringBuffer buf = new StringBuffer("GoogleLogin ");
    buf.append(auth);
    return buf.toString();
View Full Code Here

            authenticationAdminStub.logout();
        }
        catch (Exception e) {
            String msg = "Error occurred while logging out";
            log.debug(msg);
            throw new AuthenticationException(msg, e);
        }
    }
View Full Code Here

     *
     * @deprecated Use {@link #authenticate(Credentials, HttpMethod)}
     */
    public String authenticate(Credentials credentials, String method, String uri)
      throws AuthenticationException {
        throw new AuthenticationException("method not supported by Negotiate scheme");
    }
View Full Code Here

                    init( method.getURI().getHost() );
                }
            } catch (org.apache.commons.httpclient.URIException urie) {
                LOG.error(urie.getMessage());
                state = FAILED;
                throw new AuthenticationException(urie.getMessage());
            }
       
            // HTTP 1.1 issue:
            // Mutual auth will never complete do to 200 insted of 401 in
            // return from server. "state" will never reach ESTABLISHED
            // but it works anyway
            token = context.initSecContext(token, 0, token.length);
            LOG.info("got token, sending " + token.length + " to server");
        } catch (GSSException gsse) {
            LOG.fatal(gsse.getMessage());
            state = FAILED;
            if( gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL
                    || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED )
                throw new InvalidCredentialsException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.NO_CRED )
                throw new CredentialsNotAvailableException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.DEFECTIVE_TOKEN
                    || gsse.getMajor() == GSSException.DUPLICATE_TOKEN
                    || gsse.getMajor() == GSSException.OLD_TOKEN )
                throw new AuthChallengeException(gsse.getMessage(),gsse);
            // other error
            throw new AuthenticationException(gsse.getMessage());
        }
        return "Negotiate " + new String(new Base64().encode(token));
    }
View Full Code Here

     *
     * @deprecated Use {@link #authenticate(Credentials, HttpMethod)}
     */
    public String authenticate(Credentials credentials, String method, String uri)
      throws AuthenticationException {
        throw new AuthenticationException("method not supported by Negotiate scheme");
    }
View Full Code Here

                    init( method.getURI().getHost() );
                }
            } catch (org.apache.commons.httpclient.URIException urie) {
                LOG.error(urie.getMessage());
                state = FAILED;
                throw new AuthenticationException(urie.getMessage());
            }
       
            // HTTP 1.1 issue:
            // Mutual auth will never complete do to 200 insted of 401 in
            // return from server. "state" will never reach ESTABLISHED
            // but it works anyway
            token = context.initSecContext(token, 0, token.length);
            LOG.info("got token, sending " + token.length + " to server");
        } catch (GSSException gsse) {
            LOG.fatal(gsse.getMessage());
            state = FAILED;
            if( gsse.getMajor() == GSSException.DEFECTIVE_CREDENTIAL
                    || gsse.getMajor() == GSSException.CREDENTIALS_EXPIRED )
                throw new InvalidCredentialsException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.NO_CRED )
                throw new CredentialsNotAvailableException(gsse.getMessage(),gsse);
            if( gsse.getMajor() == GSSException.DEFECTIVE_TOKEN
                    || gsse.getMajor() == GSSException.DUPLICATE_TOKEN
                    || gsse.getMajor() == GSSException.OLD_TOKEN )
                throw new AuthChallengeException(gsse.getMessage(),gsse);
            // other error
            throw new AuthenticationException(gsse.getMessage());
        }
        return "Negotiate " + new String(new Base64().encode(token));
    }
View Full Code Here

        } else if (credentials instanceof GoogleLoginAuthCredentials) {
            GoogleLoginAuthCredentials gcreds = (GoogleLoginAuthCredentials)credentials;
            service = gcreds.getService();
            auth = gcreds.getAuth();
        } else {
            throw new AuthenticationException("Cannot use credentials for GoogleLogin authentication");
        }
        StringBuffer buf = new StringBuffer("GoogleLogin ");
        buf.append(auth);
        return buf.toString();
    }
View Full Code Here

        String temp = nonce + date.getValue() + password;
        try {
            MessageDigest md = MessageDigest.getInstance("SHA1");
            return new String(Base64.encodeBase64(md.digest(temp.getBytes())));
        } catch (Exception e) {
            throw new AuthenticationException(e.getMessage(), e);
        }
    }
View Full Code Here

            byte[] temp = new byte[NONCE_LENGTH];
            sr.nextBytes(temp);
            String n = new String(Hex.encodeHex(temp));
            return n;
        } catch (Exception e) {
            throw new AuthenticationException(e.getMessage(), e);
        }
    }
View Full Code Here

TOP

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

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.