jalsoedesign / persistent-oauth-google-client
A persistent oauth google client to solve the OAuth persistency (access/refresh tokens) when using server2server communication
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
This package is auto-updated.
Last update: 2025-02-21 03:52:35 UTC
README
A persistent OAuth Google Client integration to solve all the OAuth stuff when using server2server communication.
Setup
- Sign into the Google API console developer panel
- Create a new project called
SimpleGoogleClient
, or whatever you want - Click "Library" in the menu and find the libraries you want the client to support
- Go to "Credentials" in the menu and access the "OAuth consent screen" tab
- Set up the system as follows:
- Application type: Public
- Application name: SimpleGoogleClient
- Support email: (your email)
- Add the scope for whatever API you need (this depends on the services you want)
- Authorized domains: (your domain)
- Application Homepage link: (a link to your website frontpage)
- Application Privacy Policy link: (a link to your website privacy policy)
- Application Terms link: (a link to your website terms)
- Save the credentials and go back to the "Credentials" tab and click "Create credentials"
- Select "Oauth client ID - Requests user consent so your app.." from the create menu
- Select "Other" in the Application type dropdown and name it whatever you want
- Click "OK" in the popup that comes up and click the little download icon next to your OAuth credential row
- Finally take the downloaded JSON file and put it anywhere on your server, and make sure you reference it using
$config->setAuthConfig($pathToAuthConfigJson)
Examples
NOTE: These examples need you to create an oauth credentials file first!
Basic CLI
Examples using basic CLI can be found under the examples/cli
directory.
CLImax
Examples using CLImax can be found under the examples/climax
directory.