com.atlassian.sal.api.net.Request.addBasicAuthentication()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(230)

本文整理了Java中com.atlassian.sal.api.net.Request.addBasicAuthentication方法的一些代码示例,展示了Request.addBasicAuthentication的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.addBasicAuthentication方法的具体详情如下:
包路径:com.atlassian.sal.api.net.Request
类名称:Request
方法名:addBasicAuthentication

Request.addBasicAuthentication介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.plugins.rest/atlassian-rest-module

public JerseyRequest addBasicAuthentication(String hostname, String username, String password) {
  delegateRequest.addBasicAuthentication(hostname, username, password);
  return this;
}

代码示例来源:origin: com.atlassian.applinks/applinks-common

public T createRequest(final Request.MethodType methodType, final String url) {
  final URI uri;
  try {
    uri = new URI(url);
  } catch (URISyntaxException e) {
    throw new IllegalArgumentException("invalid url '" + url + "'", e);
  }
  final T request = requestFactory.createRequest(methodType, url);
  request.addBasicAuthentication(uri.getHost(), username, password);
  return request;
}

代码示例来源:origin: com.atlassian.applinks/applinks-plugin-core

@Override
public ApplicationLinkRequest addBasicAuthentication(final String hostname, final String username, final String password)
{
  return setDelegate(request.addBasicAuthentication(hostname, username, password));
}

代码示例来源:origin: com.atlassian.applinks/applinks-common

@Override
public ApplicationLinkRequest addBasicAuthentication(final String hostname, final String username, final String password) {
  return setDelegate(request.addBasicAuthentication(hostname, username, password));
}

代码示例来源:origin: com.atlassian.applinks/applinks-plugin-core

public T createRequest(final Request.MethodType methodType, final String url)
{
  final URI uri;
  try
  {
    uri = new URI(url);
  }
  catch (URISyntaxException e)
  {
    throw new IllegalArgumentException("invalid url '" + url + "'", e);
  }
  final T request = requestFactory.createRequest(methodType, url);
  request.addBasicAuthentication(uri.getHost(), username, password);
  return request;
}

代码示例来源:origin: com.atlassian.refapp/platform-ctk-plugin

protected Request createRequestWithBasicAuthentication(URI uri) {
  Request request = createRequest(uri);
  request.addBasicAuthentication(uri.getHost(), infoProvider.getAdminUsername(), infoProvider.getAdminPassword());
  return request;
}

代码示例来源:origin: com.atlassian.applinks/applinks-plugin

public boolean isAdminUserInRemoteApplication(final URI url, final String username, final String password)
    throws ResponseException {
  final URI uri = Uris.uncheckedConcatenate(url, RestUtil.REST_APPLINKS_URL);
  final AuthenticationResource restUrl = restUrlBuilder.getUrlFor(uri, AuthenticationResource.class);
  return requestFactory
      .createRequest(Request.MethodType.GET,
          restUrl.getIsAdminUser().toString())
      .addBasicAuthentication(url.getHost(), username, password)
      .executeAndReturn(new ReturningResponseHandler<Response, Boolean>() {
        public Boolean handle(final Response restResponse) throws ResponseException {
          return restResponse.isSuccessful();
        }
      });
}

代码示例来源:origin: com.atlassian.ondemand.backupmanager/on-demand-backup-manager-crowd-restclient

request.addBasicAuthentication(properties.getApplicationName(), properties.getApplicationPassword());
log.debug("Requesting " + baseURL + REST_FETCH_USERS_RELATIVE_PATH + " as " + properties.getApplicationName() + "/"
  + properties.getApplicationPassword());

代码示例来源:origin: com.atlassian.applinks/applinks-plugin

private boolean isRpcUrlValid(final URI url, final URI rpcUrl, final String username, final String password)
      throws ResponseException {
    // We send the rpcUrl parameter in a query parameter. For pre-3.4 versions of the REST resource, we also
    //  send it in the path.
    // TODO If we know the server is using applinks 3.4, the rpcUrl path parameter can be empty
    String pathUrl = getUrlFor(URIUtil.uncheckedConcatenate(url, RestUtil.REST_APPLINKS_URL), AuthenticationResource.class).rpcUrlIsReachable(internalHostApplication.getId().get(), rpcUrl, null).toString();

    String urlWithQuery = pathUrl + "?url=" + URIUtil.utf8Encode(rpcUrl);

    final Request request = requestFactory.createRequest(Request.MethodType.GET, urlWithQuery);
    request.addBasicAuthentication(url.getHost(), username, password);

    final Holder<Boolean> rpcUrlValid = new Holder<Boolean>(false);

    request.execute(new ResponseHandler<Response>() {
      public void handle(final Response restResponse) throws ResponseException {
        if (restResponse.isSuccessful()) {
          rpcUrlValid.set(true);
        }
      }
    });
    return rpcUrlValid.get();
  }
}

代码示例来源:origin: com.atlassian.notifier/notifier-core

request.addBasicAuthentication(host, subscription.getUsername(), subscription.getPassword());
return request;

代码示例来源:origin: com.atlassian.applinks/applinks-jira-plugin

request.addBasicAuthentication("", getFisheyeAdminPassword());

相关文章