https://github.com/athlan/revive-symfony-security-bundle
Revive Symfony Security integration bundle
https://github.com/athlan/revive-symfony-security-bundle
authentication authorization revive revive-adserver security symfony-bundle
Last synced: 4 months ago
JSON representation
Revive Symfony Security integration bundle
- Host: GitHub
- URL: https://github.com/athlan/revive-symfony-security-bundle
- Owner: athlan
- Created: 2016-06-28T23:58:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-13T20:04:44.000Z (almost 9 years ago)
- Last Synced: 2025-01-23T05:42:15.677Z (6 months ago)
- Topics: authentication, authorization, revive, revive-adserver, security, symfony-bundle
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Revive Symfony Security integration bundle


This bundle allows you to enable Symfony Security authentication by providing Revive Aderver credentials.
It allow you to build custom tools around Revive in Symfony Framework.
# Installation
1. Add composer dependency
```
"require": {
// ..."athlan/revive-symfony-security-bundle": "1.0.0"
// ...
},
```2. Add bundle to `AppKernel.php`
```
public function registerBundles()
{
$bundles = [
// ...
new Revive\ReviveAuthenticationBundle\ReviveAuthenticationBundle(),
// ...```
3. Define several services in your container:
```
services:
# create user session repository service
revive_user_sessions:
parent: revive_authentication.repository.user_session.xml_rpc
arguments:
# you can provide here custom configured xml_rpc client or get the existing pre-configured one
- "@revive_authentication.xml_rpc.client"# address to your Revive xml-rpc
# Example: http://domain.com/www/api/v2/xmlrpc/
# you can use parameter mechanism here
- "%revive_service_url%"# create form-autehnticacor that exchanges UsernamePasswordToken from user provided form
# to ReviveAuthenticationToken
revive_authenticator:
parent: revive_authentication.authenticator.login_form_authenticator
arguments: ["@revive_user_sessions"]# create logout listener to destroy remote sessions (optional, but recommended)
revive_authenticator_logout_handler:
parent: revive_authentication.authenticator.logout_handler
arguments: ["@revive_user_sessions"]```
4. Configure security.yml
```
security:
# regiter Revive user provider
providers:
revive:
id: revive_authentication.user_provider.revive_user_prototypefirewalls:
main:
anonymous: ~
simple_form:
# regiter Revive form authenticator
authenticator: revive_authenticator
check_path: /login
login_path: /login
csrf_token_generator: security.csrf.token_manager
logout:
path: /logout
target: /
handlers: [ revive_authenticator_logout_handler ]access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }```