ch.cyberduck.core.Protocol.getOAuthRedirectUrl()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(108)

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

Protocol.getOAuthRedirectUrl介绍

暂无

代码示例

代码示例来源:origin: iterate-ch/cyberduck

@Override
public String getOAuthRedirectUrl() {
  final String v = this.value("OAuth Redirect Url");
  if(StringUtils.isBlank(v)) {
    return parent.getOAuthRedirectUrl();
  }
  return v;
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
public Client connect(final Proxy proxy, final HostKeyCallback key, final LoginCallback prompt) {
  authorizationService = new OAuth2RequestInterceptor(builder.build(proxy, this, prompt).build(), host.getProtocol())
    .withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
  final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
  configuration.addInterceptorLast(authorizationService);
  configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(authorizationService));
  return new Client(configuration.build());
}

代码示例来源:origin: iterate-ch/cyberduck

}.withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
configuration.addInterceptorLast(authorizationService);

代码示例来源:origin: iterate-ch/cyberduck

@Override
public RequestEntityRestStorageService connect(final Proxy proxy, final HostKeyCallback key, final LoginCallback prompt) {
  authorizationService = new OAuth2RequestInterceptor(builder.build(proxy, this, prompt).build(), host.getProtocol())
    .withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
  final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
  configuration.addInterceptorLast(authorizationService);
  configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(authorizationService));
  return new OAuth2RequestEntityRestStorageService(this, this.configure(), configuration);
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
protected DbxRawClientV2 connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) {
  authorizationService = new OAuth2RequestInterceptor(builder.build(proxy, this, prompt).build(), host.getProtocol())
    .withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
  final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
  configuration.addInterceptorLast(authorizationService);
  configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(authorizationService));
  final CloseableHttpClient client = configuration.build();
  return new CustomDbxRawClientV2(DbxRequestConfig.newBuilder(useragent.get())
    .withAutoRetryDisabled()
    .withHttpRequestor(new DropboxCommonsHttpRequestExecutor(client)).build(),
    DbxHost.DEFAULT, null, null);
}

代码示例来源:origin: iterate-ch/cyberduck

@Override
protected Drive connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt) {
  authorizationService = new OAuth2RequestInterceptor(builder.build(proxy, this, prompt).build(), host.getProtocol())
    .withRedirectUri(host.getProtocol().getOAuthRedirectUrl());
  final HttpClientBuilder configuration = builder.build(proxy, this, prompt);
  configuration.addInterceptorLast(authorizationService);
  configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(authorizationService));
  this.transport = new ApacheHttpTransport(configuration.build());
  return new Drive.Builder(transport, json, new HttpRequestInitializer() {
    @Override
    public void initialize(HttpRequest request) {
      request.setSuppressUserAgentSuffix(true);
      // OAuth Bearer added in interceptor
    }
  })
    .setApplicationName(useragent.get())
    .build();
}

代码示例来源:origin: iterate-ch/cyberduck

host).withRedirectUri(Scheme.isURL(host.getProtocol().getOAuthRedirectUrl()) ? host.getProtocol().getOAuthRedirectUrl() : new HostUrlProvider().withUsername(false).withPath(true).get(
  host.getProtocol().getScheme(), host.getPort(), null, host.getHostname(), host.getProtocol().getOAuthRedirectUrl())
);
configuration.setServiceUnavailableRetryStrategy(new OAuth2ErrorResponseInterceptor(authorizationService));

相关文章