kleegroup / franceconnect-bundle
Symfony 4, 5 & 6 OpenID security extension FranceConnect
Package info
github.com/KleeGroup/FranceConnect-Symfony
Type:symfony-bundle
pkg:composer/kleegroup/franceconnect-bundle
Requires
- php: ^8.1.9
- ext-curl: *
- ext-json: *
- mashape/unirest-php: 3.*
- namshi/jose: 7.2.*
- symfony/config: 5.4.* || >=6.0
- symfony/dependency-injection: 5.4.* || >=6.0
- symfony/framework-bundle: 5.4.* || >=6.0
- symfony/http-foundation: 5.4.* || >=6.0
- symfony/http-kernel: 5.4.* || >=6.0
- symfony/routing: 5.4.* || >=6.0
- symfony/security-bundle: 5.4.* || >=6.0
Requires (Dev)
- phpunit/phpunit: ^8.5
Suggests
- doctrine/mongodb-odm: If you want store identities to mongodb
- doctrine/orm: If you want store identities to database
README
Caution
This repo has been archived and contains obsolete code. KleeGroup does not use this code anymore and won't be maintaining this repository.
FranceConnect-Symfony
Synopsis
Symfony bundle for FranceConnect authentication.
Dependencies
- namshi/jose: Utilisé pour la vérification du JWT
- Mashape/unirest-php utilisé pour les appels REST
Installation
All the installation instructions are located in documentation. The installation is in two steps:
Usage
-
Add a link to the route " france_connect_login " in your template twig
<a href="{{ path('france_connect_login') }}" class="btnLink"> <img src="{{ asset('bundles/franceconnect/images/FCboutons-10.png') }}" alt="FranceConnect button"/> </a>
-
Add a controller that will handle the response
/** * @param Request $request * @Route("/france-connect-traitement", name="app.fc.return") * @Security("is_granted('IS_AUTHENTICATED_FRANCE_CONNECT')") */ public function franceConnectAction(Request $request) { $token = $this->get('security.token_storage')->getToken(); $token->getIdentity(); // json array provided by FranceConnect [...] }
-
Add FranceConnect script in your template
{% block javascripts %} <script src="http://fcp.integ01.dev-franceconnect.fr/js/franceconnect.js"></script> {% endblock %} -
Add FranceConnect block in your template
<div id="fconnect-profile" data-fc-logout-url="{{ url('france_connect_logout') }}"> <a href="#"> {{- identity.givenName ~ ' ' ~ identity.familyName|upper -}} </a> </div>
License
This bundle is under the MIT license.