klenwell information services : GreqoDocRequestGoogleToken

Revision history for GreqoDocRequestGoogleToken


Revision [2955]

Last edited on 2016-07-09 16:54:43 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
For Google Data services, like the new [[http://code.google.com/apis/gdata/blogger.html | Blogger API]], any request or transaction must be accompanied by an authentication token set as a header for the request. This token must be requested using one of two methods promoted by Google as part of their [[http://code.google.com/apis/gdata/index.html | GData API]]. The request_clientlogin_token method will request and store a token for use with any Blogger API requests.
This method requests an authentication token from the Google servers using the [[http://code.google.com/apis/accounts/AuthForInstalledApps.html | ClientLogin interface]]
How often do you need to renew an authentication token? The answer seems to be: when in doubt, get a new token. See [[http://groups.google.com/group/bloggerDev/browse_frm/thread/f41921c75119f442 | this post]].
Deletions:
For Google Data services, like the new [[http://code.google.com/apis/gdata/blogger.html Blogger API]], any request or transaction must be accompanied by an authentication token set as a header for the request. This token must be requested using one of two methods promoted by Google as part of their [[http://code.google.com/apis/gdata/index.html GData API]]. The request_clientlogin_token method will request and store a token for use with any Blogger API requests.
This method requests an authentication token from the Google servers using the [[http://code.google.com/apis/accounts/AuthForInstalledApps.html ClientLogin interface]]
How often do you need to renew an authentication token? The answer seems to be: when in doubt, get a new token. See [[http://groups.google.com/group/bloggerDev/browse_frm/thread/f41921c75119f442 this post]].


Revision [538]

Edited on 2007-06-05 19:34:59 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
=====Greqo Docs : Requesting a Google Auth Token=====


Revision [537]

Edited on 2007-06-05 19:34:29 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
For Google Data services, like the new [[http://code.google.com/apis/gdata/blogger.html Blogger API]], any request or transaction must be accompanied by an authentication token set as a header for the request. This token must be requested using one of two methods promoted by Google as part of their [[http://code.google.com/apis/gdata/index.html GData API]]. The request_clientlogin_token method will request and store a token for use with any Blogger API requests.
$GreqoBlogger = new GreqoBlogger($debug=1);
$GreqoBlogger->email = 'user@gmail.com';
$GreqoBlogger->password = '*********';
if ( $GreqoBlogger->request_clientlogin_token($service='blogger', $force=1) )
$_HTML['stdout'] .= '<p class="success">token for user ' .$GreqoBlogger->email. ' retrieved</p>';
#$_HTML['stdout'] .= '<p class="success">token: ' .$_SESSION['GDATA']['auth_token']. '</p>';
$_HTML['stdout'] .= '<p class="failure">unable to retrieve authentication token (devs have been notified)</p>';
====Methods====
**string request_clientlogin_token( string Google service[, int force] )**
This method requests an authentication token from the Google servers using the [[http://code.google.com/apis/accounts/AuthForInstalledApps.html ClientLogin interface]]
It returns the token itself as a string if the request is successful and 0 if it fails or there is an error. It also assigns the token to **$_SESSION['GDATA']['auth_token']** for reuse within the same session.
Deletions:
For the new [[http://code.google.com/apis/gdata/blogger.html Blogger Data API]], any request or transaction must be accompanied by an authentication token set as a header for the request. This token must be requested using one of two methods promoted by Google as part of their [[http://code.google.com/apis/gdata/index.html GData API]]. If the account settings are properly set in blogger_data.inc.php, the function greqo_request_clientlogin_token will request and store a token for use with any Blogger API requests.
if ( greqo_request_clientlogin_token($GREQO['BLOGGER']['user'], $GREQO['BLOGGER']['password'], 'blogger', 1) )
$_FLAG['gdata_auth_ok'] = 1;
trigger_error('google authentication failed. make sure you have the correct account settings in blogger_data.inc.php and check the status of your blogger account', E_USER_WARNING);
====Functions====
**string greqo_request_clientlogin_token ( string user name, string password, string Google service[, int force] )**
This function requests an authentication token from the Google servers using the [[http://code.google.com/apis/accounts/AuthForInstalledApps.html ClientLogin interface]]
It returns the token itself as a string if the request is successful and 0 if it fails or there is an error. It also assigns the token to **$_SESSION['GDATA']['auth_token']** where it will be accessible as a global variable to other functions that require it within the library.
Old Blogger accounts used basic authentication to authenticate users. [[http://code.google.com/apis/gdata/blogger.html#Versions According to the Blogger Data API]], this authentication method should now work with old Blogger Accounts. However, I have not successfully authenticated an old Blogger account with this method. Meanwhile, as of this writing, basic authentication still works (see [[http://lastgoogle.blogspot.com/ lastgoogle.blogspot.com]]).


Revision [216]

Edited on 2007-02-21 14:14:27 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
**string greqo_request_clientlogin_token ( string user name, string password, string Google service[, int force] )**
Deletions:
**string greqo_request_clientlogin_token ( string user name, string password, string Google service[, array int force] )**


Revision [215]

Edited on 2007-02-21 14:13:37 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Deletions:
If the force parameter is set to 0,


Revision [59]

Edited on 2006-12-30 15:01:59 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
$_FLAG['gdata_auth_ok'] = 1;
Deletions:
$_FLAG['request_feed'] = 1;


Revision [58]

Edited on 2006-12-30 15:01:08 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
trigger_error('google authentication failed. make sure you have the correct account settings in blogger_data.inc.php and check the status of your blogger account', E_USER_WARNING);
Deletions:
trigger_error('google authentication failed. make sure you have the correct account settings in blogger_data.inc.php and check the status of your blogger account", E_USER_WARNING);


Revision [57]

Edited on 2006-12-30 15:00:30 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
%%(php)
Old Blogger accounts used basic authentication to authenticate users. [[http://code.google.com/apis/gdata/blogger.html#Versions According to the Blogger Data API]], this authentication method should now work with old Blogger Accounts. However, I have not successfully authenticated an old Blogger account with this method. Meanwhile, as of this writing, basic authentication still works (see [[http://lastgoogle.blogspot.com/ lastgoogle.blogspot.com]]).
Deletions:
Old Blogger accounts used basic authentication to authenticate users. According to the Blogger Data API, this authentication method should now work with old Blogger Accounts. However, I have not successfully authenticated an old account with this method. Meanwhile, as of this writing, basic authentication still works (see lastgoogle.blogspot.com).


Revision [56]

Edited on 2006-12-30 14:56:45 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
**string greqo_request_clientlogin_token ( string user name, string password, string Google service[, array int force] )**
If the optional ''force'' parameter is set to **0** and the token has already been requested, it will return the current token. If ''force'' is set to **1**, it will request a new token. The default is **1**.
How often do you need to renew an authentication token? The answer seems to be: when in doubt, get a new token. See [[http://groups.google.com/group/bloggerDev/browse_frm/thread/f41921c75119f442 this post]].
Deletions:
string greqo_request_clientlogin_token ( string user name, string password, string Google service[, array int force] )
If the option ''force'' parameter is set to **0** and the token has already been requested, it will return the current token. If ''force'' is set to **1**, it will request a new token.


Revision [54]

Edited on 2006-12-30 14:51:09 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]
Additions:
For the new [[http://code.google.com/apis/gdata/blogger.html Blogger Data API]], any request or transaction must be accompanied by an authentication token set as a header for the request. This token must be requested using one of two methods promoted by Google as part of their [[http://code.google.com/apis/gdata/index.html GData API]]. If the account settings are properly set in blogger_data.inc.php, the function greqo_request_clientlogin_token will request and store a token for use with any Blogger API requests.
$_FLAG['request_feed'] = 1;
trigger_error('google authentication failed. make sure you have the correct account settings in blogger_data.inc.php and check the status of your blogger account", E_USER_WARNING);
----
[[CategoryGreqo]]
Deletions:
For the new Blogger API, any request or transaction must be accompanied by an authentication token set as a header for the request. This token must be requested using one of two methods promoted by Google as part of their Data API. If the account settings are properly set in blogger_data.inc.php, the function greqo_request_clientlogin_token will request and store a token for use with any Blogger API requests.
$_FLAG['request_feed'] = 1;
trigger_error('google authentication failed. make sure you have the correct account settings in blogger_data.inc.php and check the status of your blogger account", E_USER_WARNING);


Revision [53]

The oldest known version of this page was created on 2006-12-30 14:48:52 by KlenwellAdmin [Replaces old-style internal links with new pipe-split links.]