Download the PHP package synolia/sylius-admin-oauth-plugin without Composer
On this page you can find all versions of the php package synolia/sylius-admin-oauth-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download synolia/sylius-admin-oauth-plugin
More information about synolia/sylius-admin-oauth-plugin
Files in synolia/sylius-admin-oauth-plugin
Package sylius-admin-oauth-plugin
Short Description Oauth plugin for Sylius admin.
License EUPL-1.2
Informations about the package sylius-admin-oauth-plugin
Synolia SyliusAdminOauthPlugin
Add OAuth authentication for Sylius admin panel
Features
- Allow your admin users to subscribe and sign in with OAuth providers :
- Microsoft
- Allow domain connexion management.
Requirements
Version | |
---|---|
PHP | ^8.1 |
Sylius | ^1.10 |
Installation
-
Add the bundle and dependencies in your composer.json :
-
Write your Google and/or Microsoft client Id and client secret in you .env file with those keys :
-
In your security.yaml, add the OAuth authenticator in your admin firewall and put access_control paths you need depending on wich provider you use. They must be on top of the others :
-
Create a config/routes/synolia_oauth.yaml to configure plugin's routes and to prefix them with 'admin':
-
Create a config/packages/synolia_oauth_config.yaml to import all required configs :
-
Add this trait to your App\Entity\User\AdminUser.php
-
Apply migrations to your database:
- After the first installation, no domain is configured so you have to add one to be able to connect with OAuth. If you allready have admin users, add one through the administration panel and authorize it. You can access it through OAuth domain administration section in the menu.
Don't forget to add your Allowed redirect URIs in Google cloud console or Azure Active Directory ! Full documentation here :
- Google : https://cloud.google.com/looker/docs/admin-panel-authentication-google
- Microsoft : https://learn.microsoft.com/en-en/azure/active-directory/architecture/auth-oauth2
You can now connect to your accounts with OAuth in the admin login pannel !
Troubleshootings
-
Error 'TOO_MANY_REDIRECT' : add these two lines
-
services.yaml:
- framework.yaml:
-
- If you don't see your oauth connexion button, verify your .env variables where your client_id and client_secret are specified
- If you have "Impossible to connect, try again" message, don't forget to configure your authorized domains in back-office.
Development
See How to contribute.
License
This library is under the EUPL-1.2 license.
Credits
Developed by Synolia.
All versions of sylius-admin-oauth-plugin with dependencies
knpuniversity/oauth2-client-bundle Version ^2.15
league/oauth2-google Version ^4.0
sylius/sylius Version ^1.10
thenetworg/oauth2-azure Version ^2.2