cmtz/ez-jwt
Composer 安装命令:
composer require cmtz/ez-jwt
包简介
ez-jwt allows you to create JWT tokens for Server2Server authentication on the Google APIs and can be modified to work with other OAuth Services
README 文档
README
Simple OAuth Tools
##Install
composer require cmtz/ez-jwt
##How to Use ez-jwt
####Parameters
$issuer = your@developer.gserviceaccount.com; //this would be the email issued via Google API console (Credentials)
$audience = "https://www.googleapis.com/oauth2/v3/token"; //for google jwt this is what would default
$scope = "https://www.googleapis.com/auth/content"; //for google jwt this is what would default
$key = file_get_contents(yourkeyfile.priv);
$algorithm = 'RS256'; //as of now only RS256 is supported using ez-jwt
$grant = 'urn:ietf:params:oauth:grant-type:jwt-bearer'; //for google jwt this is what would default
$APIurl = 'https://www.googleapis.com/oauth2/v3/token'; //for google jwt this is what would default
$headers = array('Content-Type' => 'application/x-www-form-urlencoded'); //this does not need to be set as it will default to what is needed but can be set to something else if needed
####Calling ezjwt
$token = ezjwt::generateToken($issuer, $audience, $scope, $key, $algorithm, $grant, $APIurl, $headers)
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-06-23