Download the PHP package uniondrug/token-auth-middleware without Composer

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

Token auth middleware component for uniondrug/framework

安装

本中间件依赖其他两个组件:uniondrug/cache 缓存服务,用于存储token, uniondrug/middleware 中间件基础组件。

修改 app.php 配置文件,加上Cache服务,服务名称tokenAuthMiddleware

配置

配置文件在 middleware.php 中,需注册中间件,以及进行中间件配置。

tokenAuthService 服务的接口

颁发Token,在应用中为用户颁发Token,一般为登录成功后调用

注销Token,一般为在主动退出时调用

返回经过认证的userid

返回经过认证的username

TokenAuthMiddleware的一般使用说明

1、按上述步骤安装配置中间件;

2、发布登录认证接口,并且将登录接口设置为whitelist

3、用户登录认证,认证成功后,调用issueToken()方法为该用户颁发token,并且将token返回给用户;

4、用户携带token,访问其他需要鉴权的接口;

5、在其他服务接口中,从请求头X-UserIdX-Username中获取用户身份信息;


All versions of token-auth-middleware with dependencies

PHP Build Version
Package Version
No informations.
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 uniondrug/token-auth-middleware contains the following files

Loading the files please wait ....