Package org.apache.wink.client

Examples of org.apache.wink.client.ClientAuthenticationException


                logger.debug("Issuing request again with Authorization header"); //$NON-NLS-1$
                response = context.doChain(request);
                if (response.getStatusCode() == 401) {
                    logger
                        .debug("After sending request with Authorization header, still got 401 response"); //$NON-NLS-1$
                    throw new ClientAuthenticationException(
                                                            "Service failed to authenticate user: " + userid); //$NON-NLS-1$
                } else {
                    logger.debug("Got a non-401 response, so returning response"); //$NON-NLS-1$
                    return response;
                }
            } else {
                logger.debug("userid and/or password were not set so throwing exception"); //$NON-NLS-1$
                // no user credential available
                throw new ClientAuthenticationException(
                                                        "Missing client authentication credential for user: " + userid); //$NON-NLS-1$
            }

        } // end if block
    } // end handle
View Full Code Here


                logger.trace("Issuing request again with Proxy-Authorization header"); //$NON-NLS-1$
                response = context.doChain(request);
                if (response.getStatusCode() == PROXY_AUTH_REQ_CODE) {
                    logger
                        .trace("After sending request with Proxy-Authorization header, still got " + PROXY_AUTH_REQ_CODE + " response"); //$NON-NLS-1$
                    throw new ClientAuthenticationException(Messages
                        .getMessage("serviceFailedToAuthenticateProxyUser", handlerUsername)); //$NON-NLS-1$
                } else {
                    logger
                        .trace("Got a non-" + PROXY_AUTH_REQ_CODE + " response, so returning response"); //$NON-NLS-1$
                    return response;
                }
            } else {
                logger.trace("proxy user and/or proxy password were not set so throwing exception"); //$NON-NLS-1$
                // no proxy user credential available
                throw new ClientAuthenticationException(
                                                        Messages
                                                            .getMessage("missingClientAuthenticationCredentialForProxyUser", handlerUsername)); //$NON-NLS-1$
            }
        } else { // did NOT get a proxy auth challenge
            logger
View Full Code Here

                logger.trace("Issuing request again with Authorization header"); //$NON-NLS-1$
                response = context.doChain(request);
                if (response.getStatusCode() == UNAUTHORIZED) {
                    logger
                        .trace("After sending request with Authorization header, still got " + UNAUTHORIZED + " response"); //$NON-NLS-1$
                    throw new ClientAuthenticationException(Messages
                        .getMessage("serviceFailedToAuthenticateUser", handlerUsername)); //$NON-NLS-1$
                } else {
                    logger.trace("Got a non-" + UNAUTHORIZED + " response, so returning response"); //$NON-NLS-1$
                    return response;
                }
            } else {
                logger.trace("user and/or password were not set so throwing exception"); //$NON-NLS-1$
                // no user credential available
                throw new ClientAuthenticationException(Messages
                    .getMessage("missingClientAuthenticationCredentialForUser", handlerUsername)); //$NON-NLS-1$
            }
        } else {
            logger
                .trace("Status code was not " + UNAUTHORIZED + " so no need to re-issue request."); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.apache.wink.client.ClientAuthenticationException

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.