-3

I've already setup a global google drive in my project where everyone is getting files from one google drive for which i had to setup keys in google console.

Now it is required to allow users to connect their own google drives. I just want it to be simpler so users do not have to do all the process on google console to get their keys to set it up.

Any guidance from seniors is much apprecaited.

1 Answers1

0

I’d recommend starting by reading about how account authentication works using Google APIs client for PHP.

Given your issue description, I believe you can achieve the desired behavior by using a Service Account.

Quoting the article above:

Google APIs such as the Prediction API and Google Cloud Storage can act on behalf of your application without accessing user information. In these situations your application needs to prove its own identity to the API, but no user consent is necessary. Similarly, in enterprise scenarios, your application can request delegated access to some resources.

In case you do need to access sensitive user information from you application in a Workspace environment, then I’d recommend having a look into Domain-wide delegation.

In this section of the github repo readme, you can find an example on how to authenticate with Google backend using a service account credentials via the client.

On additional note, I’d also recommend adhering to the How to Ask guidelines in order for your questions to be properly answered by the community. If you could also provide a minimal reproducible scenario as well as the code used and which difficulties you had with it would greatly help and improve your chances to get a meaningful answer in the future.

Gustavo
  • 639
  • 2
  • 4