The redirect_uri you should provide is the one you registered in the APIs console and where you expect to receive the Auth token.
Hello,im trying to getting access to Google Analytics Report API, but i'm always getting the "redirect_uri_mismatch" error after clicking the "grant access" button.Im using the latest PHP Client as follows:$this->_gac = new Google_Client();$this->_gac->setApplicationName('Secret Application');$this->_gac->setClientId('client id removed');$this->_gac->setClientSecret('Secret Key');$this->_gac->setRedirectUri(Mage::getUrl('statistic/google/oauth2callback')); // this generates the uri like http://some.subdomain.com/folder/index.php/statistic/google/oauth2callback$this->_gac->setDeveloperKey('developer key');$this->_gac->setScopes(array('https://www.googleapis.com/auth/analytics.readonly'));$this->_gac->setUseObjects(true);$this->_gac->setAccessType('offline');After this i generate the Link with$this->getClient()->createAuthUrl();After clicking the link, i will be redirected to google and asked for access. After clicking the button, i will be redirect to my redirect uri the controller will be triggered:public function oauth2callbackAction(){$code = $this->getRequest()->getParam('code');$client = Mage::helper('aromicon_statistic/google_analytics_data')->getClient();if(isset($code)){$client->authenticate($code);$offlineToken = $client->getAccessToken();$refreshToken = $client->getRefreshToken();Mage::getConfig()->saveConfig( Aromicon_Statistic_Helper_Data::XML_PATH_CONFIG_GOOGLEANALYTICS_ACCESS_TOKEN ,$offlineToken);Mage::getConfig()->saveConfig( Aromicon_Statistic_Helper_Data::XML_PATH_CONFIG_GOOGLEANALYTICS_REFRESH_TOKEN ,$refreshToken);}$this->_redirect('adminhtml/system_config/edit', array('section'=>'aromicon_statistic'));}--
You received this message because you are subscribed to the Google Groups "Developer Forum for Google API Access using OAuth2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oauth2-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.