In Google Docs api guide, Oauth2 are provided as an authorization method. Here are the authorization code:
$client = new Google_Client();
// Get your credentials from the console
$client->setClientId('...');
$client->setClientSecret('...');
$client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
$client->setScopes(array('https://www.googleapis.com/auth/drive'));
$service = new Google_DriveService($client);
$authUrl = $client->createAuthUrl();
// Request authorization
print "Please visit:
$authUrl
";
print "Please enter the auth code:
";
$authCode = trim(fgets(STDIN));
// Exchange authorization code for access token
$accessToken = $client->authenticate($authCode);
$client->setAccessToken($accessToken);
However, this kind of authorization requires you to click the link and authorize it manually. What I want is to use email account and password to authorize the connection, is that possible?
BTW, I do not want to use Zend-Gdata. Thanks in advance.