magium/mcm-auth0-factory 问题修复 & 功能扩展

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

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

magium/mcm-auth0-factory

Composer 安装命令:

composer require magium/mcm-auth0-factory

包简介

This library provides a configured instance of the Auth0 PHP adapter using the Magium Configuration Manager

README 文档

README

This library provides an interface for the auth0/auth0-php library so you can use it with the Magium Configuration Manager. Often applications will have some kind of static configuration mechanism, such as XML files, JSON files, YAML files, or PHP files. There's nothing necessarily wrong with that, but what it does is merge your deployment and configuration concerns. The Magium Configuration Manager (MCM) breaks that dependency so you can manage configuration separately from your deployment.

Setup

composer require magium/mcm-auth0-factory

Once it is installed you need to initialize the Magium Configuration Manager (MCM) for your project using the magium-configuration commnand. You can find it in vendor/bin/magium-configuration or, if that doesn't work you can run php vendor/magium/configuration-manager/bin/magium-configuration. For the purpose of this documentation we will simple call it magium-configuration.

Configuration

First, list all the configuration keys so you can see what they are.

$ magium-configuration magium:configuration:list-keys
Valid configuration keys
authentication/auth0/enabled

authentication/auth0/domain

authentication/auth0/client_id

authentication/auth0/client_secret

authentication/auth0/redirect_uri

authentication/auth0/audience

authentication/auth0/persist_id_token (default: 1)

authentication/auth0/persist_access_token (default: 1)

authentication/auth0/persist_refresh_token (default: 1)

Then you need to set the settings:

$ magium-configuration set authentication/auth0/domain test-domain
Set authentication/auth0/domain to test-domain (context: default)
Don't forget to rebuild your configuration cache with magium:configuration:build

... and so on

Then you need to build the configuration:

$ magium-configuration build
Building context: default
Building context: production
Building context: development

Usage

Next up, in your application code run something like this:

$factory = new \Magium\Configuration\MagiumConfigurationFactory();
$auth0Factory = new \Magium\Auth0Factory\Auth0Factory($factory->getConfiguration());

$auth0 = $auth0Factory->factory();

$user = $auth0->getUser();


You can try this in the sample test script.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固