定制 p9d/oauth2-toolkit 二次开发

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

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

p9d/oauth2-toolkit

最新稳定版本:v0.1.0

Composer 安装命令:

composer require p9d/oauth2-toolkit

包简介

README 文档

README

Tools to deal with OAuth2/OpenID protocols.

If your identity providers are providing an well-known OpenID Configuration endpoint, you can use them to discover all required things to integrate with them:

$providers = [
    'your-provider-name-here' => [
        'configuration_endpoint' => 'https://<url>/realms/ACME/.well-known/openid-configuration',
        'client_id' => 'XXXXXXXXXXXXX'
    ],
    'google' => [
        'configuration_endpoint' => 'https://accounts.google.com/.well-known/openid-configuration'
    ]   
];

$factory = new \P9D\OAuth2Toolkit\OpenIdConfigurationFactory(
    $providers,
    \Symfony\Component\HttpClient\HttpClient::create()
);


# Access provider config via:
$provider = $factory->createForProvider('your-provider-name-here');

Provider configuration:

Methods available in OpenIdConfigurationService

getAuthorizationUrl(): string

Returns a link user should be redirected to login.

parameters:

  • grantType,
  • redirectUri
  • ?clientId - when not passed, value passed in client_id from configuration will be used.
  • ?scope
  • ?state

getJwks(): array

Returns an array of JSON Web Key Set.

统计信息

  • 总下载量: 314
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-31