Download the PHP package mlukman/security-helper-bundle without Composer

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

Security Helper Bundle

About

Security Helper Bundle is a Symfony 7.x bundle that simplifies the implementation of AAA (authentication, authorization and audit) of a web application. It is a layer on top of the core Symfony Security Bundle.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

Applications that don't use Symfony Flex

Step 1: 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:

Step 2: Enable the Bundle

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

Activation

While Composer helps a lot in installing this bundle, there are some further steps that are required to activate this bundle in your web application.

Create Doctrine entity that subclasses of UserEntity

Most of the columns configuration for authentication purposes are already implemented by the UserEntity class except the #[ORM\Id] field, which is intentionally left for the subclass to implement. Feel free to add relations as needed by your database design.

Example:

Implement AuthenticationRepositoryInterface

The implementation class needs to implement the following methods:

getDefaultRedirectRoute() : string

This method should return the route to redirect to if the information about the previous route is not available. The returned route will also be used to redirect user after logout.

newUserEntity(string $method, string $credential, string $username = null): UserEntity

Create new User entity object. This method should not save the object to database yet.

queryUserEntity(string $method, string $criteriaField, string $criteriaValue): ?UserEntity

Query a User entity based on method, criteriaField and criteriaValue. This method may return null if no such entity can be found.

queryUserEntityFromSecurityUser(UserInterface $securityUser): ?UserEntity

Query a User entity based on the pass UserInterface object. This method may return null if no such entity can be found.

saveUserEntity(UserEntity $user): void

Save the passed new/modified User entity object.

sendResetPasswordEmail(UserEntity $user): void

Send a reset password email to the user.

Implement LoginControllerInterface

The implementation class needs to implement the following method:

login(Request $request, ClientRegistry $clientRegistry): Response

Show login page that should contain one or more of the followings, depending on the authentication methods that you want to implement:

Register both implementations of AuthenticationRepositoryInterface and LoginControllerInterface

Add the following to your services.yaml:

Register the bundle routing

Add a YAML file named security_helper.yaml with the following content into your config/routes folder (modify the prefix parameter to your preference):

Register with the main Symfony Security Bundle

Merge the following settings into your config/packages/security.yaml:


All versions of security-helper-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/orm Version ^2.8|^3.0
google/recaptcha Version ^1.3
knpuniversity/oauth2-client-bundle Version ^2.18
league/oauth2-facebook Version ^2.2
league/oauth2-github Version ^3.1
league/oauth2-google Version ^4.0
stevenmaguire/oauth2-keycloak Version ^5.1
symfony/console Version ^6.1|^7.0
symfony/framework-bundle Version ^6.1|^7.0
symfony/runtime Version ^6.1|^7.0
symfony/security-bundle Version ^6.1|^7.0
symfony/twig-bundle Version ^6.1|^7.0
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 mlukman/security-helper-bundle contains the following files

Loading the files please wait ....