Skip to content

alcalyn/symfony-wsse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Symfony WSSE

This library provide classes used in Symfony documentation, about a WSSE implementation.

Installation

Via Composer

{
    "require": {
        "alcalyn/symfony-wsse": "~1.0.0"
    }
}

Usage

You have to register library class in your Symfony project.

Silex

See SilexWSSE project.

Symfony full stack

Following Symfony2 documentation about WSSE:

Register services:

# app/config/services.yml
services:
    wsse.security.authentication.provider:
        class: Alcalyn\Wsse\Security\Authentication\Provider\WsseProvider
        arguments:
            - "" # User Provider
            - "%kernel.cache_dir%/security/nonces"
        public: false

    wsse.security.authentication.listener:
        class: Alcalyn\Wsse\Security\Firewall\WsseListener
        arguments: ["@security.token_storage", "@security.authentication.manager"]
        public: false

Register your WSSE security context:

// src/AppBundle/AppBundle.php
namespace AppBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Alcalyn\Wsse\DependencyInjection\Security\Factory\WsseFactory;

class AppBundle extends Bundle
{
    public function build(ContainerBuilder $container)
    {
        parent::build($container);

        $extension = $container->getExtension('security');
        $extension->addSecurityListenerFactory(new WsseFactory());
    }
}

Now you can use WSSE security in your project:

# app/config/security.yml
security:
    # ...

    firewalls:
        wsse_secured:
            pattern:   ^/api/
            stateless: true
            wsse:      true

License

This project is under MIT License.

About

WSSE implementation based on Symfony examples in documentation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages