Download the PHP package spsostrov/libsso-symfony without Composer

On this page you can find all versions of the php package spsostrov/libsso-symfony. 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 libsso-symfony

Symfony connector for SPŠ Ostrov libsso library

This is just a symfony connector for the original spsostrov/libsso library. It provides extra modules for the Symfony security bundle allowing to communicate with the school's SSO system.

Installation

Install the package into the project:

Then add the bundle SPSOstrov\SSOBundle\SSOBundle in your application bundles:

Usage

The libsso symfony connector is a Symfony bundle providing extra modules to the standard symfony security bundle. It provides two modules:

  1. The spsostrov_sso user provider.
  2. The spsostrov_sso authenticator.

Both modules are indended to be used together. The spsostrov_sso authenticator requires to use the corresponding user provider and will not work with any other user providers. On the other hand, you may override the default user provier for the given firewall rule by a specific user provider by specifying the provider argument.

Configuration

This library may be configured via security.yaml config file. A typical security.yaml may look like this:

The login controller

You need to define a specific login controller, where the authenticator will authenticate the user. At this controller the "hard work" is done. The request is redirected to the SSO server and then back. While the SSO system does not allow to pass any GET arguments through the login process, therefore it is not possible to directly pass the get arguments originally passed to the login controller into the controller's processing method. The authenticator uses here an session-based layer trying to pass all arguments properly. But the layer is not able to guarantee to work in all circumstances.

The code of the login controller's method is processed after a successfull login using the authenticator. A typical login controller may look like this:

Users

The object representing the authenticated user is an instance of SPSOstrov\SSOBundle\SSOUser which is a subclass of the original SPSOstrov\SSO\SSOUser class from the original libsso library. The user therefore provides all functions available in the original libsso library and moreover provides the getRoles() method (not available in libsso) returning the assigned roles by the role decider. (See role deciders)

Role deciders

A role decider is a service allowing to assign custom roles to existing users. You may do the role decision proces in any way you want depending on the data from the database and also on the data from the user. All you need is to create a symfony service implementing the SPSOstrov\SSOBundle\SSORoleDeciderInterface with its single method decideRoles(), which takes one argument the user being decided and is responsible for returning an array of all roles assigned to the given user. If no role decider is set up, a default role decider is used. It will decide the roles ROLE_USER (any user will have this role), ROLE_TEACHER (teachers) and ROLE_STUDENT (students).

User data providers

An user data provider is an service allowing to attach custom data (refreshed at each request) to the user. You need toimplement the SPSOstrov\SSOBundle\SSOUserDataProviderInterface with its method getUserData() taking the instance of the SSOUser class as an argument and should return the data.

The data are available then by calling the method $user->getUserData().


All versions of libsso-symfony with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
spsostrov/libsso Version >=1.8
symfony/security-bundle Version >=6.2
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 spsostrov/libsso-symfony contains the following files

Loading the files please wait ...