Download the PHP package uicosp/jwt-cas-client without Composer

On this page you can find all versions of the php package uicosp/jwt-cas-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 jwt-cas-client

jwt-cas-server

一个基于 JWT 实现「单点登陆」的 CAS,Central Authentication System 系统。

本项目依赖于 Laravel。

系统组成

用户只需在 Server 端登陆一次,获得 token 后便可用该令牌访问系统中的任意 Clients。

[注意] 此项目为该系统的客户端实现,服务端请移步 https://github.com/uicosp/jwt-cas-server

Client 端提供一个校验 token 的中间件

Uicosp\JwtCasClient\Middleware\VerifyCasToken

该中间件会验证每次请求中携带的 token 的合法性。校验失败将返回错误信息给前端。校验通过则将解密后的 token 注入到 $request 中。可通过 $request['verified_token'] 获取。verified_token 示例如下:

安装

composer require "uicosp/jwt-cas-client"

配置

1. 注册服务

本项目依赖 typmon/jwt-auth,请添加

Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class, Uicosp\JwtCasClient\CasServiceProvider::class,

config/app.phpproviders 数组。

2. 配置秘钥

方法一,通过环境变量设置

.env 文件中设置 CAS_JWT_SECRET

方法二,通过 config 文件设置

运行命令 php artisan vendor:publish --provider="Uicosp\JwtCasClient\CasServiceProvider", 将在 config 目录下新增 jwt-cas-client.php 配置文件。

修改

'jwt_secret' => env('CAS_JWT_SECRET', 'please-change-me'),

3. 添加 Middleware

Uicosp\JwtCasClient\Middleware\VerifyCasToken::class 添加到 app/Http/Kernel.php 文件中。例如:

然后在需要的地方调用,例如在 routes/web.php


All versions of jwt-cas-client with dependencies

PHP Build Version
Package Version
Requires tymon/jwt-auth Version ^0.5.9
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 uicosp/jwt-cas-client contains the following files

Loading the files please wait ...