当前位置: 首页>>代码示例>>Java>>正文


Java ClientParametersAuthentication.getClientId方法代码示例

本文整理汇总了Java中com.google.api.client.auth.oauth2.ClientParametersAuthentication.getClientId方法的典型用法代码示例。如果您正苦于以下问题:Java ClientParametersAuthentication.getClientId方法的具体用法?Java ClientParametersAuthentication.getClientId怎么用?Java ClientParametersAuthentication.getClientId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.api.client.auth.oauth2.ClientParametersAuthentication的用法示例。


在下文中一共展示了ClientParametersAuthentication.getClientId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: new10aTokenRequest

import com.google.api.client.auth.oauth2.ClientParametersAuthentication; //导入方法依赖的package包/类
/**
 * Returns a new instance of a token request based on the given verifier
 * code. This step is defined in <a
 * href="http://oauth.net/core/1.0a/#auth_step3">Obtaining an Access
 * Token</a>.
 * 
 * @param temporaryCredentials
 * @param verifierCode
 * @return
 */
public OAuthGetAccessToken new10aTokenRequest(OAuthCredentialsResponse temporaryCredentials,
        String verifierCode) {
    OAuthGetAccessToken request = new OAuthGetAccessToken(getTokenServerEncodedUrl());
    request.temporaryToken = temporaryCredentials.token;
    request.transport = getTransport();

    OAuthHmacSigner signer = new OAuthHmacSigner();
    ClientParametersAuthentication clientAuthentication = (ClientParametersAuthentication) getClientAuthentication();
    signer.clientSharedSecret = clientAuthentication.getClientSecret();
    signer.tokenSharedSecret = temporaryCredentials.tokenSecret;

    request.signer = signer;
    request.consumerKey = clientAuthentication.getClientId();
    request.verifier = verifierCode;
    return request;
}
 
开发者ID:agilie,项目名称:dribbble-android-sdk,代码行数:27,代码来源:AuthorizationFlow.java

示例2: new10aTemporaryTokenRequest

import com.google.api.client.auth.oauth2.ClientParametersAuthentication; //导入方法依赖的package包/类
/**
 * Returns the response of a Request Token request as defined in <a
 * href="http://oauth.net/core/1.0a/#auth_step1">Obtaining an Unauthorized
 * Request Token</a>.
 * 
 * @param redirectUri the {@code oauth_callback} as defined in <a
 *            href="http://oauth.net/core/1.0a/#rfc.section.6.1.1">Consumer
 *            Obtains a Request Token</a>
 * @return
 * @throws IOException
 */
public OAuthCredentialsResponse new10aTemporaryTokenRequest(String redirectUri)
        throws IOException {
    OAuthGetTemporaryToken temporaryToken =
            new OAuthGetTemporaryToken(getTemporaryTokenRequestUrl());
    OAuthHmacSigner signer = new OAuthHmacSigner();
    ClientParametersAuthentication clientAuthentication = (ClientParametersAuthentication) getClientAuthentication();
    signer.clientSharedSecret = clientAuthentication.getClientSecret();
    temporaryToken.signer = signer;
    temporaryToken.consumerKey = clientAuthentication.getClientId();
    temporaryToken.callback = redirectUri;
    temporaryToken.transport = getTransport();
    return temporaryToken.execute();
}
 
开发者ID:agilie,项目名称:dribbble-android-sdk,代码行数:25,代码来源:AuthorizationFlow.java

示例3: OfflineAuth

import com.google.api.client.auth.oauth2.ClientParametersAuthentication; //导入方法依赖的package包/类
/**
 * Creates offline-friendly auth object using a credential object.
 *
 * Use this method when your application has already performed the oauth
 * flow and needs to store and use the credential later in an offline
 * manner (e.g., via Google Cloud Dataflow).
 *
 * @param credential The credential to be used for requests.
 */
public OfflineAuth(Credential credential) {
  Preconditions.checkNotNull(credential);
  ClientParametersAuthentication clientParams =
      (ClientParametersAuthentication) credential.getClientAuthentication();
  this.clientId = clientParams.getClientId();
  this.clientSecret = clientParams.getClientSecret();
  this.refreshToken = credential.getRefreshToken();
}
 
开发者ID:googlegenomics,项目名称:utils-java,代码行数:18,代码来源:OfflineAuth.java


注:本文中的com.google.api.client.auth.oauth2.ClientParametersAuthentication.getClientId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。