PHPackages                             fsb/proxy-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. fsb/proxy-bundle

Abandoned → [flosch/proxy-bundle](/?search=flosch%2Fproxy-bundle)Symfony-bundle[HTTP &amp; Networking](/categories/http)

fsb/proxy-bundle
================

Authenticated symfony bundle: provides an authentication layer on top of a PHP proxy.

v0.1.1(10y ago)028MITPHP

Since Jul 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Flo-Schield-Bobby/FsbProxyBundle)[ Packagist](https://packagist.org/packages/fsb/proxy-bundle)[ Docs](https://github.com/Flo-Schield-Bobby/FsbProxyBundle)[ RSS](/packages/fsb-proxy-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Symfony FsbProxyBundle
======================

[](#symfony-fsbproxybundle)

Authenticated symfony bundle: provides an authentication layer on top of a PHP proxy.

This bundle provides a User model and a UserProvider, to authenticate users based on a yml file. It also provides a Symfony command to add users with encrypted passwords.

Once the user is connected, it provides a PHP proxy thanks to [8p/Guzzle-Bundle](https://github.com/8p/GuzzleBundle) and the [Guzzle PHP library](http://docs.guzzlephp.org/en/v6/), currently v6.

### Why?

[](#why)

This bundle is usefull if you want to proxy an HTTP application, with an authentication layer stronger than http standards such as HTTP\_BASIC.

### Requirements

[](#requirements)

- Symfony 2.7 or above
- 8p/GuzzleBundle (included by composer)

### Installation

[](#installation)

To install this bundle, run the command below and you will get the latest version by [Packagist](https://packagist.org/).

```
composer require fsb/proxy-bundle
```

### Usage

[](#usage)

Load required bundles in AppKernel.php:

```
// app/AppKernel.php
public function registerBundles()
{
  $bundles = array(
    // [...]
    new EightPoints\Bundle\GuzzleBundle\GuzzleBundle()
    new Fsb\Bundle\ProxyBundle\FsbProxyBundle()
  );
}
```

Set up configuration

```
# app/config/config.yml
twig:
  # [...]
  globals:
    proxy_title: Your Proxy HTML title

# FsbProxyBundle uses assetic, and for the login page,
# Both CSS, SASS and JS resources.
# However, you can override the templates and manage it yourself.
assetic:
  # [...]
  bundles: [ FsbProxyBundle ]
  filters:
    # [...]
    scss:
      # Requires ruby-sass
      apply_to: "\.scss$"
    # OPTIONALLY, you can install uglifyjs and uglifycss to minify the assets
    uglifyjs2:
      bin: "path/of/your/node_modules/.bin/uglifyjs"
    uglifycss:
      bin: "path/of/your/node_modules/.bin/uglifycss"

guzzle:
  base_url: http://localhost:8888/

fsb_proxy:
  users_provider_file_path: "path/of/users.yml"
```

Set up routing

app/config/routing.yml or any other routing file
================================================

[](#appconfigroutingyml-or-any-other-routing-file)

```
fsb_proxy:
  resource: "@FsbProxyBundle/Resources/config/routing.yml"
  prefix:   /
```

Set up security

```
# app/config/security.yml
security:
  encoders:
    # The FsbProxyBundle User model class, you can choose your favorite encoder
    Fsb\Bundle\ProxyBundle\Model\User:
      algorithm:            pbkdf2
      hash_algorithm:       sha512
      iterations:           1000000
      encode_as_base64:     true

  providers:
    # [...]
    proxy_users:
      id: fsb_proxy.provider.yaml_user_provider

  firewalls:
    # [...]
    fsb_proxy_app_login:
      pattern:  ^/login$
      security: false

    fsb_proxy_app:
      pattern:  ^/
      provider: proxy_users
      form_login:
        check_path: fsb_proxy_login_check_page
        login_path: fsb_proxy_login_page
        always_use_default_target_path: true
        default_target_path: /
      logout:
        path:   fsb_proxy_logout_page
        target: /

  access_control:
    - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/, roles: ROLE_USER }
```

### Authentication and users management

[](#authentication-and-users-management)

Here we are!

This bundle comes with a service called YamlUserProvider, providing users from a yaml file. To add an access, add a new yaml array of this user's informations :

```
# /path/of/your/users.yml
username:
  salt: # the salt used to encrypt the password
  password: # the encrypted password
```

You also have two commands to manage users from the console :

To create a new user :

```
php app/console fsb-proxy:users:create [username] [password] [--all]
```

Both username and password arguments are optionnal, the command will ask for it if you do not provide it. The `--override` (or ````-o`````) option allow to replace an existing user's password (if the user does not exists, he will be created).

To remove an existing user :

```
php app/console fsb-proxy:users:remove [username] [--all]
```

Username argument is optionnal, the command will ask for it if you do not provide it. The `--all` option allow to remove every existing users from the file.

### Extend the bundle

[](#extend-the-bundle)

The Bundle itself provides the security layer, with login and logout routes ; And a default login page, before "proxying" routes through the Guzzle client.

As a symfony bundle, you can extend it, to benefits of [Symfony inheritance](http://symfony.com/doc/2.7/cookbook/bundles/inheritance.html), Then override resources and / or controllers:

```
Controller/
  RestController.php --> Manage PHP proxy once authenticated
  Security/
    AuthenticationController.php --> Manage authentication
Resources/
  views/
    layout.html.twig --> Base template with HTML doctype
    Security/
      login.html.twig --> Login page template

```

All you need to do is setting up your own bundle as child of FsbProxyBundle:

```
// src/You/YourBundleName/YouYourBundleName.php
namespace You\YourBundleName;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class YouYourBundleName extends Bundle
{
  public function getParent()
  {
    return 'FsbProxyBundle';
  }
}
```

### Authors

[](#authors)

- Florent Schildknecht ([Portfolio](http://floschild.me))

### License

[](#license)

This bundle is released under the [MIT license](Resources/LICENSE)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3972d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe22db0c488e93bf7829a61a315899e8401d73db1c95abc787676615f7a6fa76?d=identicon)[flosch](/maintainers/flosch)

---

Top Contributors

[![flo-sch](https://avatars.githubusercontent.com/u/1577155?v=4)](https://github.com/flo-sch "flo-sch (5 commits)")

---

Tags

clientsymfonybundleproxyrestcurlhttp clientsecurityAuthentication

### Embed Badge

![Health badge](/badges/fsb-proxy-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/fsb-proxy-bundle/health.svg)](https://phpackages.com/packages/fsb-proxy-bundle)
```

###  Alternatives

[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[xabbuh/panda-bundle

integration of the Panda encoding services into the Symfony2 Framework

10174.6k](/packages/xabbuh-panda-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
