Download the PHP package irooit/hyperf-auth without Composer

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

qbhy/hyperf-auth

hyperf 的 auth 组件,目前支持 jwt、session、sso 驱动。用户可以自行扩展。
本组件参考了 laravel 的 auth 组件设计,使用体验大体和 laravel 的 auth 差不多。

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

支持的验证方式

任何问题请加QQ群提问:873213948

安装 - install

hyperf 1.1 请使用 ^v1.0 版本

配置 - configuration

使用 Qbhy\HyperfAuth\AuthExceptionHandler ,此步骤可选,开发者可以自行捕捉 AuthExceptionJWTException 进行处理

发布配置 vendor:publish

生成 .env 配置项

修改 config/autoload/auth.php

如不需要自定义 guard、model 和 user provider,则可以不修改

使用 - usage

以下是伪代码,仅供参考。Auth 注解可以用于类或者方法。

除了上面的 Auth 注解用法,还支持中间件用法

由于 hyperf 还不支持中间件传参,所以 Qbhy\HyperfAuth\AuthMiddleware 中间件只支持默认guard校验
但是开发者可以继承该中间自行扩展。或者直接使用 Auth 注解进行自定义 guard 校验,与中间件的效果是一致的。

更多用法 - API

注意事项:使用 jwt 驱动且令牌异常的情况下调用 user 方法,会抛出相应的异常,需要自行捕捉处理,不想抛异常,可以调用 check 进行判断。

扩展 - extension

由于本组件参考了 laravel auth 的设计,所以 guard 和 user provider 的扩展也和 laravel 类似。只需要实现对应接口即可。

扩展教程请移步 hyperf教程之hyperf-auth高级用法

https://github.com/qbhy/hyperf-auth
[email protected]


All versions of hyperf-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-swoole Version >=4.4
irooit/simple-jwt Version 1.4.*
hyperf/cache Version ^2.0
hyperf/di Version ^2.0
ext-json Version *
ext-redis Version *
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 irooit/hyperf-auth contains the following files

Loading the files please wait ....