GithubHelp home page GithubHelp logo

crowd-auth-bundle's Introduction

Crowd Auth Bundle

This bundle allows Symfony apps to authenticate users against Atlassian Crowd.

Build Status

Installation

Require the package via composer:

composer.json:

    "require": {
        ...
        "seiffert/crowd-auth-bundle": "dev-master",
        ...
    }

Activate the bundle and it's dependent bundle SeiffertCrowdRestBundle in your AppKernel:

app/AppKernel.php:

    public function registerBundles()
    {
        $bundles = array(
            ...
            new Seiffert\CrowdRestBundle\SeiffertCrowdRestBundle(),
            new Seiffert\CrowdRestBundle\SeiffertCrowdAuthBundle(),
            ...
        );
        ...
    }

Configuration

To connect to your organization's Crowd instance, you have to add some entries to your project configuration (e.g. in app/config/config.yml):

seiffert_crowd_rest:
    url: https://<crowd-url>/crowd/rest/usermanagement/1
    application:
        name: <application-name>
        password: <application-password>
  • crowd-url: Your Crowd instance's Url/Hostname.
  • application-name: The name of your application registered in Crowd.
  • application-password: The password of your application registered in Crowd.

To use the bundle's authentication provider, you can use it as an extension for Symfony's SecurityBundle. In your project's security.yml, you need to configure a plaintext password encoder, the bundle's user provider and use the key crowd_login insteadof form_login in your firwall definition. Everything else works exactly as with a normal form login: You decide about URLs and the login form.

Example security.yml:

security:
    encoders:
        PS\CrowdRestBundle\Crowd\User: plaintext

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        crowd:
            id: ps.crowd_auth.user_provider

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false

        login:
            pattern:  ^/auth/login$
            security: false

        secured_area:
            pattern:    ^/
            crowd_login:
                check_path: /auth/check
                login_path: /auth/login
            logout:
                path:   /auth/logout
                target: /

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

crowd-auth-bundle's People

Contributors

frastel avatar seiffert avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

crowd-auth-bundle's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.