定制 cartertech/oauth2-deputy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Latest Version Software License

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固