richardhj/oauth2-newsletter2go
Composer 安装命令:
composer require richardhj/oauth2-newsletter2go
包简介
Newsletter2Go OAuth 2.0 Client Provider for The PHP League OAuth2-Client
README 文档
README
This package provides Newsletter2Go OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Install
Via Composer
$ composer require richardhj/oauth2-newsletter2go
Usage
Use the auth key from your Newsletter2Go account to initiate the provider.
$provider = new Richardhj\Newsletter2Go\OAuth2\Client\Provider\Newsletter2Go([ 'authKey' => $authKey, ]);
Then use your login credentials to fetch an AccessToken instance.
$accessToken = $provider->getAccessToken( 'https://nl2go.com/jwt', [ 'username' => $username, 'password' => $password, ] );
Refreshing a token
Initiate the provider as described before. Then:
$accessToken = $provider->getAccessToken( 'https://nl2go.com/jwt_refresh', [ 'refresh_token' => $accessToken->getRefreshToken() ] );
It is recommended to save the refresh_token ($refreshToken = $accessToken->getRefreshToken()) in your application
rather than the username and password. Nevertheless: Handle with care!
Visit the official API documentation for reference.
License
The GNU Lesser General Public License (LGPL).
统计信息
- 总下载量: 1.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2016-08-22