I started customizing my Google calendar in my new app. I almost made an exact copy of the authentication code displayed by google developers ( https://developers.google.com/google-apps/calendar/instantiate ), but I keep getting the following error:
Error getting OAuth2 access token, message: 'invalid_grant'
I am currently using Fork-CMS ( http://www.fork-cms.com ), the young Lightweigth CMS. I set up the config.php file google-api-php-client correctly. (client-id, client-secret, redirect-uri, development key, ...), and uri redirection is set correctly on google api console. My code is as follows:
<?php class FrontendEventsWidgetCalendar extends FrontendBaseWidget { private $events = array(); private $authUrl = array(); public function execute() {
When I open this widget page for the first time, I get a Google link to authenticate the application. When I agree, I am redirected to my application and that is the moment when I get:
apiAuthException » Main Message Error fetching OAuth2 access token, message: 'invalid_grant' File C:\wamp\www\Officevibes\library/external\google-api-php-client\src\auth\apiOAuth2.php Line 105 Date Thu, 05 Apr 2012 08:34:47 +0000 URL http:
Michiel Apr 05 '12 at 9:05 2012-04-05 09:05
source share