Download the PHP package nordeus/crowd-user-bundle without Composer

On this page you can find all versions of the php package nordeus/crowd-user-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package crowd-user-bundle

CrowdUserBundle

CrowdUserBundle is a Symfony bundle used for fetching users and authenticating them against Atlassian Crowd.


Installation and setup

1. Clone this repository using composer

Execute the following in your project's root directory:

If you are using Symfony Flex

The bundle has automatically been registered and configured for you! Skip to step 4.

2. Enable the bundle in the kernel

3. Import CrowdUserBundle routing file

If you intend to manually override some of CrowdUserBundle's routes (see step 6), make sure you include this after your own bundle's config.

4. Configure parameters

These are required params:

Set up your roles_to_groups map by providing a list of Crowd groups for each Symfony role that users in those groups should receive.

There are also optional params, which have default values. These params are:

If you want to extend CrowdUser, set user_class parameter with your user class name as a value.

5. Configure your application's security

The default_target_path key is optional and may be reconfigured, it is the path where the user will be redirected after a successful login.

The access_denied_handler key is optional, and will cause access denied errors to redirect to the login page with an error message instead of breaking the request.

6. (optional) Override some of CrowdUserBundle's functionality

Suppose you want to override a controller (change some of the business logic) or a resource (template, routing, etc) from CrowdUserBundle. There are two possible approaches:

A. Bundle inheritance

When set up, any matching files in your bundle will automatically override files in CrowdUserBundle. Read the basics of setting up bundle inheritance and follow the instructions here.

B. Manual re-routing

In your own bundle, define a route using an existing CrowdUserBundle path, just have it target one of your own actions. If you need some part of the original functionality, extend the original controller/template.

7. Clear the Symfony cache


TODO


Explanation

Symfony Authentication is based on the following concept:

In security section (app/config/security.yaml) you have to define a firewall. The most common case is that you define only one firewall - main firewall. Here is en example:

Firewall implementation works like this: The firewall listens to the onKernelRequest event. When an event is triggered, it uses the firewall map to determine which firewall it will use to handle the event. The firewall map returns one if pattern matches the request path. In our case, we have only one defined firewall, which matches every path ("pattern: ^/"), so our main firewall is responsible to authenticate user on every request.

The main firewall has many authentication listeners, which could authenticate a user. Therefore, on kernel request, it iterates through all its listeners, invokes their handle methods passing them an event object. If any listener returns a Response, it breaks the loop and returns the response. Let's list those listeners.

"Custom Listeners" are where some other Authentication Listeners could be attached. In this implementation there are two Listeners: CrowdLoginAuthenticationListener and CrowdSSOAuthenticationListener. The process of "registering" authentication listeners is done through factories which implement the SecurityFactoryInterface (DependencyInjection/Security/Factory). This interface says that you have to define:

Now that we have have attached listeners to the firewall, the authentication flow is: Authentication Listener should take some data from the request (Login Listener takes username and password from login form, SSO Listener takes SSOCookieToken), then the listener creates CrowdAuthenticationToken and fills it with the data, the listener invokes authentication of the token. CrowdAuthenticationProvider receives the auth. token, fetches a CrowdUser from UserProvider with data provided in the auth. token, stores the CrowdUser in the auth. token. the listener gets the auth. token back, and then it marks the token as authenticated and stores it in the context.

How login is done: Symfony already provides the AbstractAuthenticationListener which CrowdLoginAuthenticationListener extends. AbstractAuthenticationListener does some checks (such as checking if the requested path is the path to the login page), then invokes attemptAuthentication method in CrowdLoginAuthenticationListener. The method should return the CrowdAuthenticatedToken provided by CrowdAuthenticationProvider, then AbstractAuthenticationListener invokes SuccessHandler. So CrowdLoginAuthenticationListener fetches the username and password, sends them in the CrowdAuthenticationToken; CrowdLoginSuccessHandler sets an SSO Crowd cookie in the response;

Now when the user is logged in, an auth. token is in the session. On every request, the Login Listener does nothing, except if request path matches login path. SSO Listener reads the SSO Crowd cookie and since there is an auth. token in the session it sets the authenticated flag on the token and returns it, it does not need to fetch user from Crowd server on every request. Anonymous Listener finds the auth. token in the context and does nothing. Access Listener checks if auth. token is authenticated - it is, and that's it. User stays authenticated.

As mentioned above ContextListener invokes UserProvider's refreshUser method on every request, It would be unnecessary to fetch user from Crowd on every request, UserProvider refreshes user only after "some" time, which is defined by a parameter.

If a user requests logout, Logout Listener activates, goes through all its Logout Handlers and invokes their logout methods. CrowdSSOLogoutHandler deletes SSO Crowd cookie.


All versions of crowd-user-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
php-curl-class/php-curl-class Version ^6.0
sensio/framework-extra-bundle Version ^5.0
symfony/framework-bundle Version ^3.4||^4.0
symfony/security-bundle Version *
symfony/twig-bundle Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nordeus/crowd-user-bundle contains the following files

Loading the files please wait ....