开发者

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:

  1. Get request token
  2. Aut开发者_StackOverflowhorize token
  3. 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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜