Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Using JSON credentials not working. #6

Closed
pjcjonas opened this issue Dec 14, 2016 · 2 comments
Closed

Using JSON credentials not working. #6

pjcjonas opened this issue Dec 14, 2016 · 2 comments
Labels

Comments

@pjcjonas
Copy link

Hi,

When I implement the cloud storage using my json credentials it does a oAuth check and fails. Could you please help clarify how to do this so that it validates my account properly..

Here is the laravel response:
BadRequestException in RequestWrapper.php line 283: Client error: POST https://www.googleapis.com/oauth2/v4/token` resulted in a 400 Bad Request response:
{
"error": "invalid_grant",
"error_description": "Invalid JWT: Token must be a short-lived token and in a reasonable t (truncated...)`

and here is the GCS driver setup in the filesystem

'gcs' => [ 'driver' => 'gcs', 'project_id' => env('GOOGLE_CLOUD_PROJECT_ID'), 'key_file' => storage_path(env('GOOGLE_CLOUD_KEY_FILE')), 'bucket' => env('GOOGLE_CLOUD_STORAGE_BUCKET'), 'path_prefix' => env('GOOGLE_CLOUD_STORAGE_PATH_PREFIX', null), 'storage_api_uri' => env('GOOGLE_CLOUD_STORAGE_API_URI', null), ],

Any help would be great...

@matthewgoslett
Copy link
Contributor

Have you managed to resolve your issue?

Have a look at https://cloud.google.com/storage/docs/authentication#storage-authentication-php
You need to generate a service account credentials file (json) with the correct storage scope.

@MikeyVelt
Copy link

@pjcjonas Hey, not sure if you resolved the issue but I had the same problem.
Will post this nonetheless in case someone else stumbles on this issue.
I Googled the problem and found the following answer: http://stackoverflow.com/a/36201957

Afterwards it worked for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants