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

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

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

Protocol.getOAuthTokenUrl介绍

暂无

代码示例

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

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

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

@Override
public OAuthTokens findOAuthTokens(final Host bookmark) {
  final long expiry = preferences.getLong(String.format("%s.oauth.expiry", bookmark.getProtocol().getIdentifier()));
  final String prefix = this.getOAuthPrefix(bookmark);
  return new OAuthTokens(this.getPassword(bookmark.getProtocol().getScheme(),
    bookmark.getPort(), URI.create(bookmark.getProtocol().getOAuthTokenUrl()).getHost(),
    String.format("%s OAuth2 Access Token", prefix)),
    this.getPassword(bookmark.getProtocol().getScheme(),
      bookmark.getPort(), URI.create(bookmark.getProtocol().getOAuthTokenUrl()).getHost(),
      String.format("%s OAuth2 Refresh Token", prefix)),
    expiry);
}

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

public OAuth2RequestInterceptor(final HttpClient client, final Protocol protocol) {
  this(client, protocol.getOAuthTokenUrl(), protocol.getOAuthAuthorizationUrl(), protocol.getOAuthClientId(), protocol.getOAuthClientSecret(), protocol.getOAuthScopes());
}

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

if(StringUtils.isNotBlank(credentials.getOauth().getAccessToken())) {
  this.addPassword(bookmark.getProtocol().getScheme(),
    bookmark.getPort(), URI.create(bookmark.getProtocol().getOAuthTokenUrl()).getHost(),
    String.format("%s OAuth2 Access Token", prefix), credentials.getOauth().getAccessToken());
    bookmark.getPort(), URI.create(bookmark.getProtocol().getOAuthTokenUrl()).getHost(),
    String.format("%s OAuth2 Refresh Token", prefix), credentials.getOauth().getRefreshToken());

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

public OAuth2RequestInterceptor(final HttpClient client, final Host host) {
  this(client,
      Scheme.isURL(host.getProtocol().getOAuthTokenUrl()) ? host.getProtocol().getOAuthTokenUrl() : new HostUrlProvider().withUsername(false).withPath(true).get(
          host.getProtocol().getScheme(), host.getPort(), null, host.getHostname(), host.getProtocol().getOAuthTokenUrl()),
      Scheme.isURL(host.getProtocol().getOAuthAuthorizationUrl()) ? host.getProtocol().getOAuthAuthorizationUrl() : new HostUrlProvider().withUsername(false).withPath(true).get(
          host.getProtocol().getScheme(), host.getPort(), null, host.getHostname(), host.getProtocol().getOAuthAuthorizationUrl()),
      host.getProtocol().getOAuthClientId(),
      host.getProtocol().getOAuthClientSecret(),
      host.getProtocol().getOAuthScopes());
}

相关文章