Download the PHP package jmikola/auto-login without Composer

On this page you can find all versions of the php package jmikola/auto-login. 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 auto-login

AutoLogin

This library implements a Symfony security firewall listener to authenticate users based on a single query parameter. This is useful for providing one-click login functionality in email and newsletter links.

Installation

The library is published as a package and is installable via Composer:

Compatibility

This library requires Symfony 4.3 or above.

Usage

This library implements authentication provider and firewall listener classes, which may be plugged into Symfony's security component to intercept requests and automatically authenticate users based on a single request parameter.

To utilize this library in a full-stack Symfony application, you may want to use JmikolaAutoLoginBundle. An example of registering an authentication provider and firewall listener manually may be found in the Security component documentation.

Token

When a user is automatically logged in by a token parameter in the request, they will be authenticated with an AutoLoginToken instance. In the context of authorization, this token satisfies IS_AUTHENTICATED_FULLY. Ideally, it would be possible to restrict the token to IS_AUTHENTICATED_REMEMBERED, but that is not yet supported. Additional information on these authorization levels may be found in Symfony's authorization documentation.

Events

The firewall listener may dispatch events if constructed with an event dispatcher instance.

Interactive Login

Upon successful authentication by a token parameter in the request, an interactive login core event will be dispatched with the authenticated AutoLoginToken instance.

Already Authenticated

This event was contributed by Antonio Trapani in PR #9.

If a token parameter is present in the request, but the user is already authenticated, a custom event will be dispatched, which includes the token's value. After dispatching this event, the listener's default behavior is to return immediately, since there is likely no work to be done.

A practical use for this event would be to mark a user's email addresses as confirmed, assuming the auto-login link with the token was only delivered via email. As a business requirement, the confirmation service might also listen to the interactive login core event and operate when the authenticated token was an AutoLoginToken instance.

Note: Unlike the interactive login event, the token parameter in this event will not have been validated. It will be the responsibility of the listener to check whether it matches the currently authenticated user. For this reason, it may be helpful to inject this library's provider class.

Overriding Already Authenticated Users

This feature was contributed by Mathieu Gauthier-Lafaye in PR #10.

By default, the listener will only dispatch an event if the user is already authenticated; it does not override the existing authenticated user. In some cases, it may be desirable to allow an auto-login link to override an existing authenticated user. Otherwise, the user would first need to log out before using the auto-login link. Setting the listener's override_already_authenticated boolean option to true will enable this behavior.


All versions of auto-login with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
psr/log Version ^1.0
symfony/event-dispatcher Version ^4.4 || ^5.0
symfony/http-kernel Version ^4.4 || ^5.0
symfony/security-core Version ^4.4 || ^5.0
symfony/security-http Version ^4.4.1 || ^5.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 jmikola/auto-login contains the following files

Loading the files please wait ....