Examples of RedmineApiAuthenticationException


Examples of net.sf.redmine_mylyn.api.exception.RedmineApiAuthenticationException

    }
  }
 
  protected void refreshCredentials(int statusCode, HttpMethod method, IProgressMonitor monitor) throws RedmineApiErrorException {
    if (Policy.isBackgroundMonitor(monitor)) {
      throw new RedmineApiAuthenticationException(Messages.ERRMSG_MISSING_CREDENTIALS_SYNCHRONIZATION_FAILED);
    }
   
    try {
      String message = Messages.AUTHENTICATION_REQUIRED;
      switch (statusCode) {
      case HttpStatus.SC_UNAUTHORIZED:

        Header authHeader = method.getResponseHeader(HEADER_WWW_AUTHENTICATE);
        if(authHeader!=null) {
          for (HeaderElement headerElem : authHeader.getElements()) {
            if (headerElem.getName().contains(HEADER_WWW_AUTHENTICATE_REALM)) {
              if(headerElem.getValue().equals(REDMINE_REALM)) {
                webHelper.refreshRepostitoryCredentials(message, monitor);
              } else {
                if (webHelper.useApiKey()) {
                  webHelper.refreshHttpAuthCredentials(message + ": " + headerElem.getValue(), monitor); //$NON-NLS-1$
                } else {
                  throw new RedmineApiErrorException(Messages.ERRMSG_ADDITIONAL_HTTPAUTH_NOT_SUPPORTED);
                }
              }
              break;
            }
          }
        }
        break;
       
      case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
       
        webHelper.refreshProxyCredentials(message, monitor);
        break;
       
      }
     
    } catch (OperationCanceledException e) {
      monitor.setCanceled(true);
      throw new RedmineApiAuthenticationException(Messages.AUTHENTICATION_CANCELED);
    }
  }
View Full Code Here

Examples of net.sf.redmine_mylyn.api.exception.RedmineApiAuthenticationException

  @Override
  public void refreshRepostitoryCredentials(String message, IProgressMonitor monitor) throws RedmineApiAuthenticationException {
    try {
      location.requestCredentials(AuthenticationType.REPOSITORY, message, monitor);
    } catch (UnsupportedRequestException e) {
      throw new RedmineApiAuthenticationException(Messages.ERRMSG_CANT_REQUEST_CREDENTIALS, e);
    }
  }
View Full Code Here

Examples of net.sf.redmine_mylyn.api.exception.RedmineApiAuthenticationException

  @Override
  public void refreshHttpAuthCredentials(String message, IProgressMonitor monitor) throws RedmineApiAuthenticationException {
    try {
      location.requestCredentials(AuthenticationType.HTTP, message, monitor);
    } catch (UnsupportedRequestException e) {
      throw new RedmineApiAuthenticationException(Messages.ERRMSG_CANT_REQUEST_CREDENTIALS, e);
    }
  }
View Full Code Here

Examples of net.sf.redmine_mylyn.api.exception.RedmineApiAuthenticationException

  @Override
  public void refreshProxyCredentials(String message, IProgressMonitor monitor) throws RedmineApiAuthenticationException {
    try {
      location.requestCredentials(AuthenticationType.PROXY, message, monitor);
    } catch (UnsupportedRequestException e) {
      throw new RedmineApiAuthenticationException(Messages.ERRMSG_CANT_REQUEST_CREDENTIALS, e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.