Download the PHP package madesimple/slim-auth without Composer
On this page you can find all versions of the php package madesimple/slim-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download madesimple/slim-auth
More information about madesimple/slim-auth
Files in madesimple/slim-auth
Package slim-auth
Short Description Authentication and authorisation middleware for Slim framework
License MIT
Informations about the package slim-auth
madesimple/slim-auth
An authentication and authorisation middleware for Slim 4 framework.
Installation
Authentication
A middleware to determine whether the request contains valid authentication token. The middleware has been designed so that it can easily be extended to:
- handle any type of token retrieval;
- handle any type of validation method; and,
- perform any set of actions if authentication was successful.
To use an Authentication middleware to your Slim application simply:
Side node: We recommend that if you are going to be adding same authentication to more than more groups/routes to put the middleware in dependencies.php
.
Default options for authentication are:
When authentication fails the middleware throws an HttpUnauthorizedException
is thrown.
SimpleTokenAuthentication
Simple token authentication is an implementation of Authentication which allows the user to provide a callable to validate a token. The callable is passed to Simple token authentication using the option:
The callable should have the following signature:
JwtAuthentication
JWT authentication is an implementation of Authentication which allows the user to use JWT as authentication tokens. JWT authentication overrides the default regex, and adds two extra options:
Authorisation
A middleware to determine whether an authenticated request has authorisation to access the requested route.
When Authorisation fails the middleware throws an HttpForbiddenException
exception.
Note: If you need to access the route from within your app middleware you will need to add the Middleware\RoutingMiddleware
middleware to your application just before you call run()
.
All versions of slim-auth with dependencies
slim/slim Version ^4
psr/log Version ^1
psr/http-server-middleware Version ^1.0