yasirsiddiqui / php-google-cloud-print

PHP class to print documents using Google Cloud Print with OAuth2 authorization
91 stars 42 forks source link

Error: Cant login to google #19

Closed omerfarooX closed 8 years ago

omerfarooX commented 8 years ago

Well i was really really excited about this service and made some tiny tweaks to the code to select printer from a dropdown etc and it worked well on my local server but once uploaded to the test server it throws an exception. (I am not sure if its due to SSL, because i dont have a certificate on my domain.)

Fatal error: Uncaught exception 'Exception' with message 'Please first login to Google' in /srv/disk6/2002385/www/cloudprint.dx.am/GoogleCloudPrint.php:121 Stack trace: #0 /srv/disk6/2002385/www/cloudprint.dx.am/example.php(30): GoogleCloudPrint->getPrinters() #1 {main} thrown in /srv/disk6/2002385/www/cloudprint.dx.am/GoogleCloudPrint.php on line 121

I had setup the configurations as described in the settings and i am also using OFFLINE as access type. But for some reason the server is not able to communicate with the app.

I also found a stackoverflow thread with the same issue with the print api. Here is the link http://stackoverflow.com/questions/32113440/fatal-error-uncaught-exception-exception-with-message-please-first-login-to

It would be great if you could point me in the right direction.

der-lukas commented 8 years ago

Did you generate a new offline access token for this server or is it the same as the one you used on your local environment?

Did you add the domain in your google app?

Maybe you could try to set it up on a different server to verify if the issue is due to this server! That's at least the things I would try! ;)

omerfarooX commented 8 years ago

I haven't generated a new token its the same one that i used for local env. But i did edit the domain in the google app, as well as the config file. Can you please confirm that you are successfully running this code on your server without an SSL?

yasirsiddiqui commented 8 years ago

Can you generate new token and follow steps as mentioned in readme file?

fuser82 commented 7 years ago

Hi, I follow all the steps in the README file but having the same error: Fatal error: Uncaught exception 'Exception' with message 'Please first login to Google' in GoogleCloudPrint.php on line 121 , what could be the problem? I get to the screen where it asks permissions to connect my account with the app I created in Cloud Print... but after that it throws the error

yasirsiddiqui commented 7 years ago

This exception is thrown when you try to get printer list without authtoken. Can you check if you set correct redirect url in your Google app?