PHPackages                             smurfy/crowd-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. smurfy/crowd-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

smurfy/crowd-bundle
===================

Allows auth against the atlassian crowd

11.6kPHP

Since Aug 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/smurfy/AsaAyersCrowdBundle)[ Packagist](https://packagist.org/packages/smurfy/crowd-bundle)[ RSS](/packages/smurfy-crowd-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Provides Atlassian Crowd authorisation AsaAyersCrowdBundle

Features
========

[](#features)

- Standalone SSO support
- Form Login support

Authors
=======

[](#authors)

- Original Author AsaAyers ()
- Heavily modified and pushed to github by smurfy

Installation
============

[](#installation)

Add AsaAyersCrowdBundle to your vendor/bundles/ dir
---------------------------------------------------

[](#add-asaayerscrowdbundle-to-your-vendorbundles-dir)

Using the vendors script

Add the following lines in your `deps` file

```
[AsaAyersCrowdBundle]
    git=git://github.com/smurfy/AsaAyersCrowdBundle.git
    target=bundles/AsaAyers/CrowdBundle

[AtlassianServicesCrowd]
    git=git://github.com/smurfy/AtlassianServicesCrowd.git
    target=Atlassian

```

Run the vendors script

```
./bin/vendors install

```

Add the AsaAyers namespace to your autoloader
---------------------------------------------

[](#add-the-asaayers-namespace-to-your-autoloader)

```
// app/autoload.php
$loader->registerNamespaces(array(
    'AsaAyers'         => __DIR__.'/../vendor/bundles',
    // your other namespaces
);

$loader->registerPrefixes(array(
    'Services_Atlassian' => __DIR__.'/../vendor/Atlassian/lib',
    //Other prfixes
));

// on the bottom of autoload.php For Atlassian Lib include path
set_include_path(get_include_path() . ':' . __DIR__ . '/../vendor/Atlassian/lib');

```

Add AsaAyersCrowdBundle to your application kernel
--------------------------------------------------

[](#add-asaayerscrowdbundle-to-your-application-kernel)

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new AsaAyers\CrowdBundle\AsaAyersCrowdBundle(),
        // ...
    );
}

```

Configuration
=============

[](#configuration)

Configure parameters in config.yml (or in the parameters.ini)
-------------------------------------------------------------

[](#configure-parameters-in-configyml-or-in-the-parametersini)

```
parameters:
    crowd_application_user: username
    crowd_application_password: password
    crowd_wsdl: https://yourdomain.com/crowd/services/SecurityServer?wsdl

```

Configure your Firewalls
------------------------

[](#configure-your-firewalls)

```
security:
    factories:
        - "%kernel.root_dir%/../vendor/bundles/AsaAyers/CrowdBundle/Resources/config/security_factories.xml"

    providers:
        crowd: ~
        # All of a user's Crowd groups will become ROLE_${group_name} with spaces and dashes converted to underscores.
        # crowd-administorators becomes ROLE_CROWD_ADMINISTRATORS
    firewalls:
        main:
            # You can use sso standalone, but the crowd login itself also needs crowd_sso enabled
            crowd_sso: true
            crowd:
                # You can use here the same as of form_login
                cookie_domain: yourdomain.com
            logout:
                delete_cookies:
                    crowd.token_key: { path: /, domain: yourdomain.com }

```

Use AsaAyersCrowdBundle in combination with FOSUserBundle
=========================================================

[](#use-asaayerscrowdbundle-in-combination-with-fosuserbundle)

This example shows you how you can use AsaAyersCrowdBundle with FOSUserBundle. The users roles will be merged with the already existing roles from the crowd. If the user does not exist in the FOSUserBundle Database it will be created.

Create a new UserProvider
-------------------------

[](#create-a-new-userprovider)

```
namespace Acme\MyBundle\Security\User\Provider;

use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserInterface;

class CrowdUserProvider implements UserProviderInterface
{
    protected $crowd;
    protected $userManager;

    /**
     * Cosntructor
     *
     * @param Services_Atlassian_Crowd $crowd       The Crowd
     * @param mixed                    $userManager The Fos UserManager
     *
     * @return void
     */
    public function __construct(\Services_Atlassian_Crowd $crowd, $userManager)
    {
        $this->crowd = $crowd;
        $this->userManager = $userManager;
    }

    /**
     * {@inheritDoc}
     */
    public function supportsClass($class)
    {
        return $this->userManager->supportsClass($class);
    }

    /**
     * Loads the user from the crowd, but other stuff from db over userbundle
     *
     * @param string $username The username
     *
     * @return User
     */
    public function loadUserByUsername($username)
    {
        $groups = $this->crowd->findGroupMemberships($username);

        if (isset($groups->string))
        {
            $user = $this->userManager->findUserByUsername($username);
            if (empty($user)) {
                $user = $this->userManager->createUser();
                $user->setEnabled(true);
                $user->setUsername($username);
                $user->setPassword('');
                $user->setEmail($username);
            }

            foreach ($groups->string as $group_name)
            {
                $group_name = 'ROLE_'.strtoupper($group_name);
                $group_name = str_replace(array(' ', '-'), '_', $group_name);
                $user->addRole($group_name);
            }
            $this->userManager->updateUser($user);
            return $user;
        }
        throw new UsernameNotFoundException($username);
    }

    /**
     * {@inheritDoc}
     */
    function refreshUser(UserInterface $user)
    {
        return $this->loadUserByUsername($user->getUsername());
    }
}

```

Configure your Services
-----------------------

[](#configure-your-services)

```
services:
    my.crowd.user:
        class: Acme\MyBundle\Security\User\Provider\CrowdUserProvider
        arguments:
            crowd: "@crowd"
            userManager: "@fos_user.user_manager"

```

Configure your Firewalls
------------------------

[](#configure-your-firewalls-1)

```
security:
    factories:
        - "%kernel.root_dir%/../vendor/bundles/AsaAyers/CrowdBundle/Resources/config/security_factories.xml"

    providers:
        fos_userbundle:
            id: my.crowd.user
    firewalls:
        main:
            # You can use sso standalone, but the crowd login itself also needs crowd_sso enabled
            crowd_sso: true
            crowd:
                # You can use here the same as of form_login
                provider: fos_userbundle
                cookie_domain: yourdomain.com
            logout:
                delete_cookies:
                    crowd.token_key: { path: /, domain: yourdomain.com }

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c3da3004d291ef38e2bdf498514db689c4920de045061acfc82992b416a7087?d=identicon)[smurfy](/maintainers/smurfy)

---

Top Contributors

[![smurfy](https://avatars.githubusercontent.com/u/805790?v=4)](https://github.com/smurfy "smurfy (12 commits)")

### Embed Badge

![Health badge](/badges/smurfy-crowd-bundle/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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