leowebguy / google-oauth
A minimal Craft plugin to provide Google OAuth login
Package info
github.com/leowebguy/google-oauth
Type:craft-plugin
pkg:composer/leowebguy/google-oauth
2.0
2026-05-15 15:06 UTC
Requires
- php: ^8.2
- craftcms/cms: ^5.0
- google/apiclient: ^2.19
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
- craftcms/rector: dev-main
README
A minimal Craft plugin to provide Google OAuth login
Installation
composer require "leowebguy/google-oauth" -w && php craft plugin/install google-oauth
Composer
Craft 4
"require": { "leowebguy/google-oauth": "^1.0", }
Craft 5
"require": { "leowebguy/google-oauth": "^2.0", }
Credentials
Gather the necessary info from GoogleOAuth
Go to https://console.cloud.google.com/auth/clients
- Select a Project
- Create client
- Pick "Web application"
- Give it a name
- Add "Authorized JavaScript origins" i.e. https://myapp.ddev.site (Optional)
- Add "Authorized redirect URIs" i.e. https://myapp.ddev.site/oauth/g/auth
The URI has to be "/oauth/g/auth"
Added to your Craft App URL i.e. https://myapp.ddev.site/oauth/g/auth
- Copy Client ID and Secret
- Paste/Save /admin/settings/plugins/google-oauth
- Add ID/Secret to .env (Optional)
### OAUTH
GOOGLE_CLIENT_ID=111-xxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=AAA-123qwe




