CakePHP-Google icon indicating copy to clipboard operation
CakePHP-Google copied to clipboard

Opauth

Open davidsteinsland opened this issue 11 years ago • 2 comments

You should really try to implement your API using the original CakePHP Opauth library. Access tokens can just be set via a method, no need to use sessions for that.

PS! I'm using the original Opauth library, and would be glad if you didn't require your own fork ..

davidsteinsland avatar Aug 08 '13 16:08 davidsteinsland

I am using Opauth library just for oAuth dance, to get access tokens. I wrote this plugin because of Models which relates to Google's api methods, For example

$uses = array('Google.GoogleDriveFiles');
...
$data = $this->GoogleDriveFiles->listItems();
debug ($data);

This is not possible with original CakePHP Opauth library, you would have to extend it. Writing additional plugins seems to be better solution for me..

LubosRemplik avatar Aug 09 '13 06:08 LubosRemplik

We are already storing the access tokens in database, so it would seem natural to me to just send the access token as a parameter to your models.

$data = $this->GoogleDriveFiles->listItems($accessToken);

davidsteinsland avatar Aug 09 '13 11:08 davidsteinsland