Download the PHP package yymou/easyjwt without Composer

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

EasyJwt

如果你想要快速上手并将jwt运用到项目中,就来试试EasyJwt吧!

它尽可能的简化使用jwt的一些前期工作,composer拉过来两三行代码即用, 你甚至不用去管理秘钥...

此处阅读jwt的相关信息:

安装

完毕后引入到项目

之后就可以愉快的使用啦

示例

搞定


如果你想个性化一下参数的话 可以往下看...

以下 EasyJwt\Jwt() 均写为 $jwtObj;

  1. 你可以定义加密的算法

    1. 支持的算法如下:
      • HS256
      • HS384
      • HS512
      • RS256
      • RS384
      • RS512
    2. 示例 (两种方式, 以"HS256"为例)

  2. 你可以自定义加密秘钥

    1. 根据加密算法不同 需要秘钥的类型也不同 openssl需要私钥公钥, hmac只需要一个秘钥即可
    2. 示例

    如果不定义自己的秘钥, easyJwt会帮你自动生成秘钥文件, 路径存放在: {你的项目路径}/vendor/yymou/easyjwt/src/secret/ 下, 结构如下:

    • vendor
      • yymou
      • easyJwt
        • secret
        • hmac.key -- hmac算法使用秘钥
        • openssl-private.key -- openssl算法使用私钥
        • openssl-public.key -- openssl算法使用公钥

    需要的话可以自行查阅, 注意各环境的秘钥不要污染!

  3. 你可以自定义token过期时间
    1. 默认的过期时间是86400s
    2. 示例

解析token

实例代码 (仅供参考) php 7.2+


All versions of easyjwt with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
nowakowskir/php-jwt Version ^2.0
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 yymou/easyjwt contains the following files

Loading the files please wait ...