markocupic / contao-oauth2-client
Contao OAuth2 Client
Installs: 16
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.2
- contao/core-bundle: ^5.2
- league/oauth2-client: ^2.7
- markocupic/contao-twig-assets: ^1.1
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/security-core: ^6.4|| ^7.0
- symfony/security-http: ^6.4 || ^7.0
Requires (Dev)
- contao/manager-plugin: ^2.12
README
Contao OAuth2 Client
This extension serves as a wrapper plugin for OAuth2 plugins like contao-github-login and contains a backend and frontend authenticator.
Follow these steps to create your oauth2 plugin.
- Create a bundle and name it
vendorname/contao-***-login
- In your composer require 'markocupic/contao-oauth2-client', the OAuth base extension
league/oauth2-github
an e.g.league/oauth2-client
. Have a look at knpuniversity/oauth2-client-bundle to find the client library of your choice. - Create for your backend and your frontend authenticators the
***BackendClientFactory
and***FrontendClientFactory
class. Both classes have to extendMarkocupic\ContaoOAuth2Client\OAuth2\Client\AbstractClientFactory
. - As client name you should choose something like this:
github_frontend
orgoogle_backend
. Use only letters and the underscore. - Create for your button generator class
ButtonGenerator
that have to implementMarkocupic\ContaoOAuth2Client\ButtonGenerator\ButtonGeneratorInterface
- Create your
Extension
andConfiguration
class in thesrc/DependencyInjection
folder. - Create your button and store it in the templates/backend directory of your bundle.
- Create the frontend template
mod_login_***
that extends@MarkocupicContaoOAuth2Client/frontend/modules/_mod_login_oauth2_base.html.twig
button and store it in the templates/backend directory of your bundle.