Package org.exoplatform.social.client.api.auth

Examples of org.exoplatform.social.client.api.auth.UnAuthenticatedException


  @Override
  public void setBasicAuthenticateToRequest() throws SocialClientLibException {
    if (delegate == null) return;
    if (SocialClientContext.getUsername() == null || SocialClientContext.getPassword() == null) {
      //fast check from client
      throw new SocialClientLibException("401 Unauthorized", new UnAuthenticatedException());
    }
    delegate.getCredentialsProvider().setCredentials(new AuthScope(SocialClientContext.getHost(), SocialClientContext.getPort()),
                                                     new UsernamePasswordCredentials(SocialClientContext.getUsername(), SocialClientContext.getPassword()));
    delegate.addRequestInterceptor(preemptiveAuthInterceptor ,0);
  }
View Full Code Here


      if(statusCode == 404){
        throw new SocialClientLibException(response.getStatusLine().toString(), new NotFoundException());
      } else if(statusCode == 403){
        throw new SocialClientLibException(response.getStatusLine().toString(), new AccessDeniedException());
      } else if(statusCode == 401){
        throw new SocialClientLibException(response.getStatusLine().toString(), new UnAuthenticatedException());
      } else {
        throw new ServiceException(response.getStatusLine().toString());
      }
    }
  }
View Full Code Here

      if(statusCode == 404){
        throw new SocialClientLibException(response.getStatusLine().toString(), new NotFoundException());
      } else if(statusCode == 403){
        throw new SocialClientLibException(response.getStatusLine().toString(), new AccessDeniedException());
      } else if(statusCode == 401){
        throw new SocialClientLibException(response.getStatusLine().toString(), new UnAuthenticatedException());
      } else if (statusCode == 301) {
        /** handle redirect */
        Header[] headers = response.getHeaders("Location");
        if (headers != null && headers.length != 0) {
          String newUrl = headers[headers.length - 1].getValue();
View Full Code Here

TOP

Related Classes of org.exoplatform.social.client.api.auth.UnAuthenticatedException

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.