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
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A minimal Craft plugin to provide Google OAuth login.
Requirements
This plugin requires:
- Craft CMS:
^5.0.0 - PHP:
^8.2 || ^8.3 || ^8.4 || ^8.5
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.1" }
Credentials
Gather the necessary info from Google Cloud Console:
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 in
/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
Development & Quality Tools
Run code quality analysis, style formatting, and migrations via Composer:
# Static analysis (PHPStan Level 8) composer stan # Code style check & fix (Laravel Pint / PSR-12) composer pint-test composer pint # Craft 5 Rector migration check composer rector




