Skip to content
Advertisement

Trouble deploying Laravel Passport with Google App Engine (GAE)

I have successfully deployed and maintained a Google App Engine + Laravel Project using Google Cloud SQL as a database. I’m using Cloud Build to deploy, however on manual deployment my problem occurs just the same. I’m trying to get the locally working Laravel Passport installation to work on Google App Engine.

Laravel Passport needs to run php artisan passport:install in order to generate it’s encryption keys and stow them into the database.
The only slot where this is possible in the GAE automatic build process is in "post-install-cmd":[] in composer, however at that stage the database connection is not established yet. => SQL Error while running passport:install


However

I have also tried SSHing into the App Engine Instance and running passport:install manually, chmod’ing the storage directory to 0600, chown’ing the required passport encryption keys to www-data and yet I still get the following error:
LogicException Key path "file:///app/storage/oauth-private.key" does not exist or is not readable

I am at a lack of options now and sadly cannot find a reference where Laravel Passport has been deployed to a GAE Project.

What I’m looking for is another viewpoint of what might be going wrong. Am I missing something with permissions that’s specific to Google App Engine?

Thanks in advance!

Advertisement

Answer

i got the same issue and this solution worked for me. please translate in english as the content on this site is in chinese.

Put passport settings in environment variables

Creating a configuration file.

Embed file contents in environment variables

The following files are created in

storage/oauth-private.key

storage/oauth-private.key

Put the contents of this key file in the configuration file as follows

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement