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

GCP Authorization #8

Open
MaresPradana opened this issue Dec 12, 2019 · 1 comment
Open

GCP Authorization #8

MaresPradana opened this issue Dec 12, 2019 · 1 comment

Comments

@MaresPradana
Copy link

What steps will reproduce the problem?

I use this configuration to access my Google Cloud Storage project from components.
'fs' => [
'class' => 'dosamigos\flysystem\GoogleCloudFsComponent',
'projectId' => $params['gcsProjectId'],
'bucket' => $params['gcsBucket'],
// 'prefix' => 'your-prefix',
],

What is the expected result?

I can access the GCS

What do you get instead?

{ error: { code: 401, message: Invalid Credentials, errors: [ { message: Invalid Credentials, domain: global, reason: authError, locationType: header, location: Authorization } ] } }

I though this error was occurred on authorization process or Maybe something were wrong when authorization process occurred.

@gogl92
Copy link

gogl92 commented May 15, 2021

@MaresPradana the easiest way I found was to adding the env path of the service account something like:

putenv("GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service_account.json");

put it into your config file. I put it on config/web.php

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

No branches or pull requests

2 participants