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