Download the PHP package bitgrave/persona-bundle without Composer
On this page you can find all versions of the php package bitgrave/persona-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bitgrave/persona-bundle
More information about bitgrave/persona-bundle
Files in bitgrave/persona-bundle
Package persona-bundle
Short Description Integrate mozilla persona authentification service into your Symfony2 application.
License MIT
Homepage https://github.com/paterik/BGPersonaBundle
Informations about the package persona-bundle
Introduction
This Bundle enables integration of mozillas PERSONA verification API. It also provides a Symfony2 authentication provider so that users can login to a Symfony2 via persona's Remote Verification API. Furthermore via custom user provider support the persona login can also be integrated with some other data sources like the database based solution provided by the famous FOSUserBundle.
Note that logging in a user requires 3 steps:
- the user must have a valid personal authentification account
- you have to trigger the symfony2 login
- add the persona login button (twig helper) inside your login.html.twig template or any other place you like
In our example code lines below we'll presume the our local webserver is reachable under http://dev.example.com. please change this domain by our development base server here.
further information about persona verifaction api can be found on https://developer.mozilla.org/de/docs/persona
Please also refer to the official documentation of the SecurityBundle, especially for details on the configuration: http://symfony.com/doc/current/book/security.html
Prerequisites
This version requires Symfony 2.1
Installation
1 - Add the following lines in your composer.json:
2 - Run the composer to download the bundle
3 - Add this bundle to your application's kernel:
4 - Configure the persona
service in your config:
4.1. If you want to use security component
add this configuration and define a custom user provider class,
use it as provider or define login path (you can replace the given name my_persona.persona_provider by any
other (distinct) one) ...
5 - add routing for persona logincheck handler.
6 - (optional) add persona host-ident configuration inside your parameters.yml this step is not really necessary, you can place your host identification in config.yml (_bg_persona:)
7 - place this dummy controller inside your LoginController file. this code presume you've sendio FrameworkExtraBundle installed and implemented (Route and Template module), if not setup person routing (/persona_login_check) inside your default routing.yml file.
Include the persona login button in your templates
add the following code in your login template (thats a twig sample for persona CSS3 button):
Example Custom User Provider using the BG\PersonaBundle
This requires adding a service for the custom user provider which is then set to the provider id in the "provider" section in the config.yml:
The Custom User Provider Class:
Finally one also needs to add a getPersonaId() and setPersonaId() method to the User model. take note that field placements firstname and lastname not realy neccesary for our persona bundle implementation. The following example using the Doctrine ORM + FOSUserBundle:
How To Contribute
To contribute changes, fixes, additions/features please open a pull request with your new code. please take not, that if you add new features or modify existing ones you have to doc this in projects README file (also update projects CHANGELOG file!)
License
See: resources/meta/LICENSE.md
Credits
The bundle structure and documentation partially based on FOSFacebookBundle by FriendsOfSymfony on any open questions or problems feel free to contact me directly or just open an issue ...
All versions of persona-bundle with dependencies
symfony/framework-bundle Version >=2.1,<2.3-dev
symfony/security-bundle Version >=2.1,<2.3-dev
symfony/twig-bundle Version >=2.1,<2.3-dev