Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deuxhuithuit/craft-agency-auth
Allows us to login into Craft CMS with our Google Login
https://github.com/deuxhuithuit/craft-agency-auth
craft-plugin craftcms craftcms-plugin hacktoberfest
Last synced: about 1 month ago
JSON representation
Allows us to login into Craft CMS with our Google Login
- Host: GitHub
- URL: https://github.com/deuxhuithuit/craft-agency-auth
- Owner: DeuxHuitHuit
- License: mit
- Created: 2021-09-20T16:48:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-13T18:33:55.000Z (4 months ago)
- Last Synced: 2024-11-19T02:53:03.380Z (about 1 month ago)
- Topics: craft-plugin, craftcms, craftcms-plugin, hacktoberfest
- Language: PHP
- Homepage: https://packagist.org/packages/deuxhuithuit/craft-agency-auth
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Agency Auth
> This plugin allows us to log in the control panel with our Google Account.
> [!NOTE]
> This is meant to be internally used by Deux Huit Huit and might not do what you want.
> Pull Requests are welcome :)## Create and save the credentials
1. [Create OAuth client ID here](https://console.cloud.google.com/apis/credentials/oauthclient)
2. Application type to Web application
3. Name the credentials with the client's project name
4. Add the authorized redirect URIs according to your setup. e.g. `https://example.com/actions/agency-auth/callback` no language are required.
5. Save the credentials
6. Fill the credentials in the `/config/agency-auth.php` file
7. Commit the changes## config/agency-auth.php
The possible settings are:
```php
[
'client_id' => '',
'client_secret' => '',
'domain' => '',
'default_password' => '',
'photo_volume_handle' => '', // optional
'photo_folder_name' => '', // optional
]
];
```## src/AgencyAuth.php
This file will prevent the manual login with a password into craft's CP. It will also add js and css into the login page for the oauth2 dialog button.## src/controllers/DialogController.php
This will only redirect the user to the oauth2 dialog.## src/controllers/CallbackController.php
This will handle the oauth2 callback and login the user.## mod_sec
Rule id 930120 does not like the `.profile` string in Google's response, so make sure
to tweak it for your needs.