Download the PHP package dilsonjlrjr/slim3-auth without Composer

On this page you can find all versions of the php package dilsonjlrjr/slim3-auth. 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 slim3-auth

slim3-auth

Module Auth Slim 3

Installation:

You can install the library directly from composer / packagist:

$ composer require "dilsonjlrjr/slim3-auth"

Dependencies:

Usage:

The slim3 -auth uses three components in your authentication process:

Adapters:

The adaptares are responsible for defining the authentication rules. Every adapter implements AuthAdapterInterface interface and uses its constructor as input. All adapter should return a type AuthResponse object. Below an adapter instance.

use SlimAuth\AuthResponse;
use SlimAuth\AuthAdapterInterface;

class AuthTestAdapter implements AuthAdapterInterface
{

    private $username;

    private $password;

    /**
     * AuthTestAdapter constructor.
     * Data entry
     * @param string $username
     * @param string $password
     */
    public function __construct(string $username, string $password)
    {
        $this->username = $username;
        $this->password = $password;
    }

    function authenticate() : AuthResponse
    {
        if ($this->username == 'username' && $this->password == 'password') {
            return new AuthResponse(AuthResponse::AUTHRESPONSE_SUCCESS, 'User auth success', 'Slim3Auth', [ 'id' => 1010 ]);
        }

        return new AuthResponse(AuthResponse::AUTHRESPONSE_FAILURE, 'Failure');
    }

}
Adapters - Methods

authenticate

Define:
    Authenticates according to the rules defined in the implemented class
Params:
    no params;
Return:
    SlimAuth\AuthResponse

AuthResponse

The AuthResponse class indicates the result of the authentication process. It has constants that define states, AUTHRESPONSE_SUCCESS (Successful authentication), AUTHRESPONSE_FAILURE (Authentication failed).

AuthResponse - Methods

__construct

Define:
    Set message result autenticate
Params:
    $code [int] - AUTHRESPONSE_SUCCESS or AUTHRESPONSE_FAILURE;
    $message [string] - Defined user. Message result authentication;
    $keyAttributeSession [string] - Key used for session rescue;
    $attributesSession [array] - Array with attributes session;
Return:
    no returns;

setMessage

Define:
    Set message result autenticate
Params:
    $code [int] - AUTHRESPONSE_SUCCESS or AUTHRESPONSE_FAILURE;
    $message [string] - Defined user. Message result authentication;
    $keyAttributeSession [string] - Key used for session rescue;
    $attributesSession [array] - Array with attributes session;
Return:
    no returns;

getMessage

Define:
    Get array message
Params:
    no params;
Return:
    no returns;
Example:
    [
        $code, [int]
        $message, [string]
        $keyAttributeSession, [string]
        $attributesSession, [array]
    ]

FacadeAuth:

This facade runs an adapter set in advance and stored in session attributes set by the adapter.

FacadeAuth - Methods

__construct

Define:
    The class constructor
Params:
    $authAdapter [SlimAuth\AuthAdapterInterface] - implemented adapter interface SlimAuth\AuthAdapterInterface;
    $session [RKA\Session] - Stored Session

Return:
    no returns;

auth

Define:
    Auth method
Params:
    no params;
Return:
    no returns;

isValid

Define:
    It indicates whether the authentication was valid
Params:
    no params;
Return:
    boolean;

Contact:

Email: [email protected]

All versions of slim3-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
akrabat/rka-slim-session-middleware Version ^2.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 dilsonjlrjr/slim3-auth contains the following files

Loading the files please wait ....