hamidatyabi/auth2
Composer 安装命令:
composer require hamidatyabi/auth2
包简介
Provides authorization api
README 文档
README
You can use this library for connect to your authentication server
Login and get new token
You can send username and password and get new token
$config = array( "oauth2_host" => "localhost", "oauth2_port" => "port", "oauth2_client_id" => "client_id", "oauth2_client_secret" => "client_secret" ); $client = new \HamidAtyabi\OAuth2Client\AccessToken\AccessToken($config); $result = $client->get("username", "password");
Check your AccessToken
You can check access_token validity with server
$config = array( "oauth2_host" => "localhost", "oauth2_port" => "port", "oauth2_client_id" => "client_id", "oauth2_client_secret" => "client_secret" ); $client = new \HamidAtyabi\OAuth2Client\AccessToken\AccessToken($config); $result = $client->validity("access_token");
Refresh your token
You can refresh your token by refresh_token
$config = array( "oauth2_host" => "localhost", "oauth2_port" => "port", "oauth2_client_id" => "client_id", "oauth2_client_secret" => "client_secret" ); $client = new \HamidAtyabi\OAuth2Client\RefreshToken\RefreshToken($config); $result = $client->refresh("refresh_token");
Get user details information
You can get details of user information
$config = array( "oauth2_host" => "localhost", "oauth2_port" => "port", "oauth2_client_id" => "client_id", "oauth2_client_secret" => "client_secret" ); $client = new \HamidAtyabi\OAuth2Client\User\User($config); $result = $client->get("access_token");
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-18