Download the PHP package waywake/auth-client without Composer

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

Waywake Auth Client

waywake/auth-client 是公司内部 Auth 系统的 PHP 客户端包,面向 Laravel/Lumen 12 和 13 应用。它通过 waywake/json-rpc 调用 Auth 服务,提供:

环境要求

开发测试使用 PHPUnit 11,覆盖率使用 PCOV。

安装

如果项目没有自动加载服务提供者,需要手动注册:

Laravel 项目可发布配置:

Lumen 项目在应用启动时注册服务提供者即可,包会调用 configure('pdauth')

配置

配置文件来源是 config/auth.php,合并到应用配置键 pdauth

默认支持的应用:

常用环境变量:

APP_ENV 会影响 Auth Web 地址:

RPC_AUTH_URI 用于 JSON-RPC 客户端访问 Auth 服务。若应用容器里已经绑定 rpc.auth,本包会优先复用该客户端;否则会创建 JsonRpc\Client 并选择 auth endpoint。

控制器用法

控制器中引入 PdAuth\Controller trait,并在构造函数中选择 guard:

auth($guard) 会完成:

权限配置

CheckRole 会读取当前路由 action 对应控制器上的 Privileges。支持常量或静态属性:

规则:

前端登录流程

未登录访问受保护接口时:

示例响应:

扫码登录后 Auth 会返回 pd_codeapp_id,前端调用:

成功后返回 token 数据,并写入 token cookie。

退出登录:

响应中的 data.url 是 Auth 系统退出地址,客户端可继续跳转。

Auth API

也可以按 app_id 选择应用:

路由

服务提供者会注册:

token.json 返回 JSON,token.html 写 cookie 后重定向到 /

测试

安装依赖:

运行测试:

使用 PCOV 生成覆盖率:

当前测试覆盖核心类:

tests/1.php 是历史手动调试脚本,不属于 PHPUnit 测试套件。


All versions of auth-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/http Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
waywake/json-rpc Version ^2.2
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 waywake/auth-client contains the following files

Loading the files please wait ...