CakePHP-Google
CakePHP-Google copied to clipboard
Opauth
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 ..
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..
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);