Download the PHP package kuleuven/authentication-bundle without Composer

On this page you can find all versions of the php package kuleuven/authentication-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 authentication-bundle

This bundle adds a shibboleth authentication firewall to your Symfony3 project.

SensioLabsInsight Build Status Code Coverage Scrutinizer Code Quality

Latest Stable Version Dependency Status Latest Unstable Version Dependency Status

Installation

Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

Shibboleth

Setup the Symfony firewall

By default, the bundle will use a default Shibboleth user provider. This is an in-memory user provider that will get your user on the fly, based on the server attributes.

You can setup the firewall to check specific attribute requirements before authentication. By default, this is set to the Shib-Identity-Provider needed to be 'urn:mace:kuleuven.be:kulassoc:kuleuven.be'.

Setup Shibboleth in the .htaccess file in your public folder

Change Shibboleth Service Provider settings (optional)

Overwrite Shibboleth server attributes (optional)

The Shibboleth firewall will by default use the server environment. To be succesfully authenticated, at least two attributes should be present:

If you don't have Shibboleth running locally, you could add these attributes manually to your server environment, or add them to the $_SERVER array in for example your app_dev.php.

Parameter injector

This bundle however lets you overwrite any attribute from within your parameters.yml, through the '\Kuleuven\AuthenticationBundle\Service\ParameterAttributesProvider' service that uses the 'authentication_attribute_overwrites' parameter to inject an array of server attributes.

By default this feature is disabled, so you have to explicitly enable it.

Now you can add your overwrites to your parameters.yml.

The parameter injector will always overwrite any other server attributes, unless you would overwrite the priority of the service. By default the priority is set to -INF.

Header injector

You could also overwrite specific attributes in your request, through the '\Kuleuven\AuthenticationBundle\Service\HeaderAttributesProvider' service that uses the symfony request headers to inject an array of server attributes.

By default this feature is disabled, so you have to explicitly enable it.

Now you can use something like Requestly to overwrite attributes in your application, by sending them as headers with your request.

The header injector will always overwrite any other server attributes, unless you would overwrite the priority of the service. By default the priority is set to -INF.

LDAP attributes injector

You can use LDAP to request some of the server attributes from a specific person, through the '\Kuleuven\AuthenticationBundle\Service\LdapAttributesProvider' service that uses the 'authentication_attribute_ldap_filter' parameter to inject an LDAP result array of server attributes.

By default this feature is disabled, so you have to explicitly enable it.

Once enabled, you can add your LDAP filter. Make sure the filter is unique enough to only provide one user.

It might be possible that you also need to enable LDAP - if so, jump to the LDAP chapter further down.

Custom injector

If you want to add other services to populate your server attributes, they should implement '\Kuleuven\AuthenticationBundle\Service\AttributesInjectionProviderInterface', and should be tagged with 'kuleuven_authentication.shibboleth_attributes_injector'.

Change the default firewall settings (optional)

For more control, there are two more firewall settings that can be overwritten:

Overwrite the attribute definitions

By default, the bundle exposes several Shibboleth attributes through the user token KuleuvenUserToken or the user KuleuvenUser. Attributes can be accessed through getAttribute, getSingleAttribute, getArrayAttribute or hasAttributeValue, with their id or aliases as the argument.

The built-in SP variables are:

Variable Meaning
Shib-Application-ID The applicationId property derived for the request.
Shib-Authentication-Instant The ISO timestamp provided by the IdP indicating the time of authentication.
Shib-Authentication-Method The AuthenticationMethod or value supplied by the IdP, if any.
Shib-AuthnContext-Class The AuthenticationMethod or value supplied by the IdP, if any.
Shib-AuthnContext-Decl The value supplied by the IdP, if any.
Shib-Handler The self-referential base location of the SP's "handlers" for use by applications in requesting login, logout, etc.
Shib-Identity-Provider The entityID of the IdP that authenticated the user associated with the request.
Shib-Session-ID The internal session key assigned to the session associated with the request.

The KU Leuven provides a long list of usable attributes. A non-exhaustive list:

id aliases multivalue
Shib-Application-ID false
Shib-Session-ID false
Shib-Identity-Provider false
Shib-Authentication-Instant false
Shib-Authentication-Method false
Shib-AuthnContext-Class false
Shib-AuthnContext-Decl false
Shib-Handler false
eppn user false
affiliation Shib-EP-ScopedAffiliation, eduPersonScopedAffiliation true
unscoped-affiliation Shib-EP-UnscopedAffiliation, eduPersonAffiliation true
entitlement Shib-EP-Entitlement, eduPersonEntitlement false
targeted-id Shib-TargetedID, eduPersonTargetedID false
persistent-id false
primary-affiliation Shib-EP-PrimaryAffiliation, eduPersonPrimaryAffiliation false
nickname Shib-EP-Nickname, eduPersonNickName false
primary-orgunit-dn Shib-EP-PrimaryOrgUnitDN, eduPersonPrimaryOrgUnitDN false
orgunit-dn Shib-EP-OrgUnitDN, eduPersonOrgUnitDN true
org-dn Shib-EP-OrgDN, eduPersonOrgDN false
cn Shib-Person-commonName false
sn Shib-Person-surname false
givenName Shib-Person-givenName false
mail Shib-Person-mail false
uid Shib-Person-uid false
telephoneNumber Shib-Person-telephoneNumber true
title false
initials ?
description false
carLicense ?
departmentNumber ?
displayName ?
employeeNumber ?
employeeType ?
preferredLanguage ?
manager ?
seeAlso ?
facsimileTelephoneNumber Shib-Person-facsimileTelephoneNumber true
postalAddress Shib-Person-postalAddress true
street ?
postOfficeBox ?
postalCode ?
st ?
l ?
o ?
ou Shib-Person-ou true
businessCategory ?
physicalDeliveryOfficeName ?
roomNumber Shib-Person-roomNumber true
KULluditServer Shib-KUL-luditServer false
KULprimouNumber Shib-KUL-PrimouNumber true
KULouNumber Shib-KUL-ouNumber true
KULtap Shib-KUL-tap false
KULemployeeType Shib-KUL-employeeType true
KULdipl Shib-KUL-dipl true
KULopl Shib-KUL-opl true
KULstamnr Shib-KUL-stamnr false
KULid Shib-KUL-id false
KULlibisnr Shib-KUL-libisnr false
KULstudentType Shib-KUL-studentType true
KULcampus Shib-KUL-campus false
userAppUserID false
syncoreLogonCode false
KULMoreUnifiedUID false
KULCardApplicationId true
KULCardSN true
KULPreferredMail false
KULMainLocation true
KULAssocUCCtag true
KULOfficialGivenName false
logoutURL Shib-logoutURL false
uidToledo Shib-uidToledo false
aid Shib-assoc-aid false
HomeOrganization ?
HomeOrganizationType ?
KULAssocSAPID ?
KULAssocLibisPID ?
KULAssocLibisNbr ?
KULAssocMigrateID ?

You can always extend these definitions by adding definitions into the parameter 'authentication_attribute_definitions'.

LDAP

Change LDAP settings (optional)

If you have your own LDAP credentials, you may use those by setting the LDAP parameters. The default settings however should work as long as you are connected to the KU Leuven network.

Impersonate users (optional)

Through LDAP, we have the possibility to impersonate any KU Leuven member.

Allthough the Shibboleth authentication is stateless itself, for this to work it needs to save a token to the session. You don't need to change the stateless key though, as the Shibboleth authentication will still check the Shibboleth session of the source user to make sure the session stays alive.

To enable this, you need to add an LDAP user provider. However, we also still need our Shibboleth user provider. So let's add a chain_provider, and overwrite the firewall provider. Also add the switch_user attribute, and detect some default_role to check if a user may impersonate.

Typical development setup

Both using the overwrites and LDAP, there is a very easy setup to enable local development without installing Shibboleth.

Enable the overwrites and provide the overwrite for the Shib-Identity-Provider attribute in config_dev.yml. Also enable LDAP in config_dev.yml.

Add your uid by adding this to your parameters.yml(.dist). It will be ignored in production.

Extra

There is a default route "/authentication".

Check if you are behind a certain firewall with the FirewallHelper service.

Upcoming

Security

Logging

Data Collector

Switch User

Docker

Extra

References

Reference Status


All versions of authentication-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
symfony/http-foundation Version ^3.1
symfony/http-kernel Version ^3.1
symfony/templating Version ^3.1
symfony/config Version ^3.1
symfony/dependency-injection Version ^3.1
symfony/security Version ^3.1
symfony/security-bundle Version ^3.1
symfony/event-dispatcher Version ^3.1
symfony/dom-crawler Version ^3.1
symfony/ldap Version ^3.1
psr/log 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 kuleuven/authentication-bundle contains the following files

Loading the files please wait ....