mathieu-dumoutier/oauth2-envconfig 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mathieu-dumoutier/oauth2-envconfig

Composer 安装命令:

composer require mathieu-dumoutier/oauth2-envconfig

包简介

OAuth2 Client generic provider for config by .env file

README 文档

README

This package provides OAuth 2.0 generic support from config .env file for the PHP League's OAuth 2.0 Client.

Installation

To install, use composer:

composer require mathieu-dumoutier/oauth2-envconfig

Usage

Usage is the same as The League's OAuth client, using \MathieuDumoutier\OAuth2\Client\Provider\EnvConfig as the provider.

knpuniversity/oauth2-client-bundle configuration example

knpu_oauth2_client:
    clients:
        yourapp_oauth:
            type: generic
            provider_class: MathieuDumoutier\OAuth2\Client\Provider\EnvConfigProvider
            provider_options:
                "scopes": '%env(OAUTH2_SCOPES)%'
                "app_url": '%env(OAUTH2_BASE_APP_URL)%'    
                "api_url": '%env(OAUTH2_BASE_API_URL)%'    
            client_id: '%env(OAUTH2_CLIENT_ID)%'
            client_secret: '%env(OAUTH2_CLIENT_SECRET)%'
            redirect_route: oauth2_check
            redirect_params: {}
            use_state: false

You must define 6 environment variables :

  • OAUTH2_CLIENT_ID
  • OAUTH2_CLIENT_SECRET
  • OAUTH2_SCOPES (scopes would you want requested)
  • OAUTH2_BASE_APP_URL
  • OAUTH2_BASE_API_URL

You must create the route "oauth2_check" in a controller :

#[Route('/oauth2_check', name: 'oauth2_check')]
public function oauth2Check(): void
{
    // This action is not executed because onAuthenticationSuccess() method of the OAuth2Authenticator class redirect before
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-25