|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.ads.common.lib.auth.ClientLoginTokens
public class ClientLoginTokens
ClientLogin token provider.
Example usage:
String clientLoginToken = new ClientLoginTokens(ClientLoginTokens.ADWORDS_SERVICE).fromFile();
| Field Summary | |
|---|---|
static String |
ADWORDS_SERVICE
Service to use to request ClientLogin tokens for AdWords. |
static String |
DFP_SERVICE
|
| Constructor Summary | |
|---|---|
ClientLoginTokens(String service)
Constructor. |
|
| Method Summary | |
|---|---|
String |
from(org.apache.commons.configuration.Configuration config)
Obtains a ClientLoginToken either stored in the specified configuration or using an email and password stored in the configuration to obtain a new one Understands the following properties suffixes: clientLoginToken email password For example, the AdWords ClientLoginToken can be read from: api.adwords.clientLoginToken |
String |
from(String email,
String password)
Requests the user's authentication token. |
String |
from(String email,
String password,
String loginToken,
String loginCaptcha)
Requests the user's authentication token. |
String |
fromFile()
Loads credentials from a properties file in one of the following locations according to the following order: in the current directory, in the user home directory, in the classpath |
String |
fromFile(File path)
Populates this builder from a properties file from a specified path. |
String |
fromFile(String path)
Populates this builder from a properties file from a specified path. |
String |
fromFile(URL path)
Populates this builder from a properties file from a specified path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ADWORDS_SERVICE
public static final String DFP_SERVICE
| Constructor Detail |
|---|
public ClientLoginTokens(String service)
service - the service name i.e. gam or adwords| Method Detail |
|---|
public String fromFile()
throws ClientLoginException
ClientLoginException
public String fromFile(String path)
throws ClientLoginException
path - the path to try first as a resource, then as a file
ClientLoginException
public String fromFile(File path)
throws ClientLoginException
path - the path to load properties from
ClientLoginException
public String fromFile(URL path)
throws ClientLoginException
path - the path to try first as a resource, then as a file
ClientLoginException
public String from(org.apache.commons.configuration.Configuration config)
throws ClientLoginException
api.adwords.clientLoginToken
config -
ClientLoginException
public String from(String email,
String password)
throws ClientLoginException
email - the email to fetch the token forpassword - the password to fetch the token for
ClientLoginException - if the token could not be generated
public String from(String email,
String password,
String loginToken,
String loginCaptcha)
throws ClientLoginException
email - the email to fetch the token forpassword - the password to fetch the token forloginToken - the login token. Can be null if not needed.loginCaptcha - the login CAPTCHA. Can be null if not needed.
ClientLoginException - if the token could not be generated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||