Browse files

Adding basic files

1 parent cc98635 commit aad22ed9984db99cd2ec01e4b5c209ee273de670 lcobucci committed on 8 Mar 2014
Showing with 884 additions and 3 deletions.
    @@ -0,0 +1,5 @@
    +.buildpath
    +.project
    +.settings/
    +vendor
    +build
 
 

View

49  README.md
    @@ -1,4 +1,47 @@
    -jwt
    -===
    +# JWT
     
    -A simple library to work with JSON Web Token and JSON Web Signature
    +master [![Build Status](https://secure.travis-ci.org/lcobucci/jwt.png?branch=master)](http://travis-ci.org/#!/lcobucci/jwt)
    +develop [![Build Status](https://secure.travis-ci.org/lcobucci/jwt.png?branch=develop)](http://travis-ci.org/#!/lcobucci/jwt)
    +
    +[![Total Downloads](https://poser.pugx.org/lcobucci/jwt/downloads.png)](https://packagist.org/packages/lcobucci/jwt)
    +[![Latest Stable Version](https://poser.pugx.org/lcobucci/jwt/v/stable.png)](https://packagist.org/packages/lcobucci/jwt)
    +
    +A simple library to work with JSON Web Token and JSON Web Signature (requires PHP 5.5+)
    +
    +## Instalation
    +
    +Just add to your composer.json: ```"lcobucci/jwt": "1.x"```
    +
    +## Basic usage
    +
    +### Creating
    +
    +Just use the builder to create a new JWT/JWS tokens:
    +
    +```php
    +<?php
    +use Lcobucci\JWT\Builder;
    +use Lcobucci\JWT\Signer\Sha256;
    +
    +$token = (new Builder())->setIssuer('http://example.com') // Configures the issuer (iss claim)
    + ->setAudience('http://example.org') // Configures the audience (aud claim)
    + ->setId('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
    + ->set('uid', 1) // Configures a new claim, called "uid"
    + ->sign(new Sha256(), 'my key') // Signs the token with HS256 using "my key" as key
    + ->getToken(); // Retrieves the generated token
    +
    +echo $token; // The string representation of the object is a JWT string (pretty easy, right?)
    +```
    +### Parsing from strings
    +
    +Use the parser to create a new token from a JWT string:
    +
    +```php
    +<?php
    +use Lcobucci\JWT\Parser;
    +
    +$token = (new Parser())->parse('...'); // Parses from a string
    +$token->getHeader(); // Retrieves the token header
    +$token->getClaims(); // Retrieves the token claims
    +$token->verify('my key'); // Verifies if the signature was created with given key (if token is signed)
    +```
    @@ -0,0 +1,27 @@
    +{
    + "name" : "lcobucci/jwt",
    + "description" : "A simple library to work with JSON Web Token and JSON Web Signature",
    + "type" : "library",
    + "authors" : [{
    + "name" : "Luís Otávio Cobucci Oblonczyk",
    + "email" : "lcobucci@gmail.com",
    + "role": "Developer"
    + }
    + ],
    + "keywords" : ["JWT", "JWS"],
    + "license" : ["BSD-3-Clause"],
    + "require" : {
    + "php" : ">=5.5"
    + },
    + "require-dev" : {
    + "phpunit/phpunit" : "4.0.x",
    + "squizlabs/php_codesniffer" : "*",
    + "phpmd/phpmd" : "*"
    + },
    + "autoload" : {
    + "psr-4" : {
    + "Lcobucci\\JWT\\" : "src",
    + "Lcobucci\\JWT\\Test\\" : "test"
    + }
    + }
    +}
 

Large diffs are not rendered by default.

    @@ -0,0 +1,23 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<phpunit
    + colors="true"
    + backupGlobals="false"
    + backupStaticAttributes="false"
    + bootstrap="vendor/autoload.php"
    + strict="true">
    + <testsuites>
    + <testsuite name="JWT Test Suite">
    + <directory>test</directory>
    + </testsuite>
    + </testsuites>
    +
    + <filter>
    + <whitelist processUncoveredFilesFromWhitelist="true">
    + <directory suffix=".php">src</directory>
    + </whitelist>
    +
    + <blacklist>
    + <directory suffix=".php">vendor</directory>
    + </blacklist>
    + </filter>
    +</phpunit>

0 comments on commit aad22ed

 

Please sign in to comment.

Adding basic files · lcobucci/jwt@aad22ed · GitHub的更多相关文章

  1. Adding Swap Files

    Adding Swap Files If you do not have free disk space to create a swap partition and you do need to a ...

  2. springboot成神之——basic auth和JWT验证结合

    本文介绍basic auth和JWT验证结合 目录结构 依赖 config配置文件WebSecurityConfig filter过滤器JWTLoginFilter filter过滤器JWTAuthe ...

  3. lcobucci/jwt的安装和使用

    安装 composer require lcobucci/jwt 3.3 封装 <?php namespace tools\jwt; use Lcobucci\JWT\Builder; use ...

  4. GitHub - firebase/php-jwt: PEAR package for JWT

        PHP-JWT A simple library to encode and decode JSON Web Tokens (JWT) in PHP, conforming to RFC 75 ...

  5. git配置ssh(github)

    [参考官方文档] SSH keys are a way to identify trusted computers, without involving passwords. The steps be ...

  6. JWT(Json Web Token)初探与实践

    前言什么是JWT?为什么使用JWT?什么时候使用JWT?JWT的基本结构HeaderPayloadSignature将他们放在一起项目实践JWT后端前端关于安全性总结参考 协议标准:https://t ...

  7. JWT在PHP使用及问题处理

    官网 https://jwt.io/ 3.0版本 https://github.com/lcobucci/jwt 安装 composer require lcobucci/jwt 依赖 PHP 5.5 ...

  8. API安全验证之JWT(JSON WEB TOKEN) OLCMS

    假如www.olcms.com/getUserInfo获取用户信息,你怎么知道当前用户是谁?有人说登陆时候我把他UID写入session了,如果是API接口,没有session怎么办,那么就需要把UI ...

  9. 基于JWT的Token登录认证(一)

    1.JWT简介 JSON Web Token(缩写 JWT),是目前最流行的跨域认证解决方案. session登录认证方案:用户从客户端传递用户名.密码等信息,服务端认证后将信息存储在session中 ...

随机推荐

  1. intrinsicContentSize和Content Hugging Priority

    Mgen | 首页 | | 发新文章 | 联系 | 订阅  | 管理 iOS: 在代码中使用Autolayout (2) - intrinsicContentSize和Content Hugging ...

  2. Error-Idea:Process finished with exit code 1

    ylbtech-Error-Idea:Process finished with exit code 1 1.返回顶部 1. log4j:WARN No appenders could be foun ...

  3. Eclipse反编译插件jd-eclipse安装指南

    Java Decompiler是一款比较好用的反编译工具,包括: JD-GUI:独立java编译工具 JD_Eclipse:用于Eclipse的反编译插件 下面主要介绍jd-eclipse的获取和安装 ...

  4. Servlet与Struts的区别

    启动: ● Servlet:无 ● Struts:配置filter,设置struts入口 创建: ● Servlet:继承HttpServlet,重写doGet与doPost方法: 添加注解或配置we ...

  5. 2018-8-10-dotnet-从入门到放弃的-500-篇文章合集

    title author date CreateTime categories dotnet 从入门到放弃的 500 篇文章合集 lindexi 2018-08-10 19:16:52 +0800 2 ...

  6. vs 快捷键 (空格显示 绿点, Tab 显示箭头)

    VS 快捷键 (空格显示 绿点, Tab 显示箭头)   VS 有用的快捷键 : Ctrl + r, ctrl + w, 切换空格示.

  7. [转]C# 中的委托和事件 + 观察者模式

    引言 委托 和 事件在 .Net Framework中的应用非常广泛,然而,较好地理解委托和事件对很多接触C#时间不长的人来说并不容易.它们就像是一道槛儿,过了这个槛的人,觉得真是太容易了,而没有过去 ...

  8. Ionic 列表、文本 自动 换行

    1.采用row 布局的row-warp 来处理 <div class="item item-icon-right"> <span>图片相册</span ...

  9. 不同目录cookie共享的问题解决 cookie不同页面访问不到的问题

    一般设置cookie的方法是setcookie(key, value, expire),参数分别的意思是建.值.过期时间,这里是大众的默认设置方法,但是忽略了一个问题,setcookie还有path与 ...

  10. 使用内部Servlet转发JSP后页面的JS,CSS等资源引入问题的解决

    转载自:https://blog.csdn.net/weixin_44353336/article/details/90677792 问题原因 我们在进行web项目开发过程中,经常会在web页面引入一 ...