Google OAuth - how to reuse access token
I am a little confused how to use Google OAuth. From what I understand, the process is this:
- Get request token
- Aut开发者_StackOverflowhorize token
- Get access token
I can do all these steps successfully with the PHP library "oauth-php". However, I cannot figure out how to re-use the access token retrieved in the third step!
NOTE: I am using oauth-php's "Session" storage. There is a "mysql" storage option, but I cannot use this as my DBA is very strict on mysql stuff.
I have tried this code (which I think would be logical), but to no avail:
$this->_store->addServerToken(
$this->_oauthOptions['consumer_key'], // our consumer key
'access', // the request token's type
$accessToken, // the request token
'', // token secret - is blank (we're using OpenID + OAuth)
0
);
I fixed the code.. I had some misunderstanding of OAuth and didn't realize I needed both the access token and the secret. Its working great now!
精彩评论