cartertech/oauth2-deputy
最新稳定版本:0.2.0-alpha
Composer 安装命令:
composer require cartertech/oauth2-deputy
包简介
Deputy OAuth 2.0 Client Provider for The PHP League OAuth2-Client
README 文档
README
This package provides Deputy OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Usage
Usage is similar to The League's OAuth client, using \Cartertech\OAuth2\Client\Provider\Deputy as the provider.
Authorization Code Flow
$provider = new Cartertech\OAuth2\Client\Provider\Deputy([ 'clientId' => <your_client_id>, // The client ID assigned to you by the provider 'clientSecret' => <your_client_secret>, // The client password assigned to you by the provider 'redirectUri' => 'https://example.com/callback.php, 'urlAuthorize' => 'https://once.deputy.com/my/oauth/login', 'urlAccessToken' => 'https://once.deputy.com/my/oauth/access_token' ]);
For further usage of this package please refer to the core package documentation on "Authorization Code Grant".
To configure Deputy to allow OAuth authentication please refer to Deputy's documentation.
Refreshing a Token
$existingAccessToken = getAccessTokenFromYourDataStore(); if ($existingAccessToken->hasExpired()) { $newAccessToken = $provider->getAccessToken('refresh_token', [ 'refresh_token' => $existingAccessToken->getRefreshToken() ]); // Purge old access token and store new access token to your data store. }
Storing the endpoint URL for the Provider's use
$provider->setDomain($accessToken->getEndpointUrl());
For further usage of this package please refer to the core package documentation on "Refreshing a Token".
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-06