public class OfflineCredentials extends Object
Credential credential = new OfflineCredentials.Builder()
.forApi(OfflineCredentials.Api.ADWORDS)
.fromFile()
.build()
.generateCredential();
This can be also used instead of service accounts. Generate a refresh token
once and place it in your ads.properties file to be read by this utility.Modifier and Type | Class and Description |
---|---|
static class |
OfflineCredentials.Api
Enum representing the API that OfflineCredentials can be used for.
|
static class |
OfflineCredentials.Builder
Pre-builder for OfflineCredentials.
|
static class |
OfflineCredentials.ForApiBuilder
Builder for OfflineCredentials.
|
Modifier and Type | Method and Description |
---|---|
com.google.api.client.auth.oauth2.Credential |
generateCredential()
Generates a new offline credential and immediately refreshes it.
|
String |
getClientId() |
String |
getClientSecret() |
com.google.api.client.http.HttpTransport |
getHttpTransport() |
String |
getRefreshToken() |
public com.google.api.client.http.HttpTransport getHttpTransport()
public String getRefreshToken()
public String getClientId()
public String getClientSecret()
public com.google.api.client.auth.oauth2.Credential generateCredential() throws OAuthException
OAuthException
- if the credential could not be refreshed.Copyright © 2014. All Rights Reserved.