定制 mahmoodr786/cakephp-auth0 二次开发

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

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

mahmoodr786/cakephp-auth0

Composer 安装命令:

composer require mahmoodr786/cakephp-auth0

包简介

CakePHP plugin for validating Auth0 JWT token and authenticating the user.

README 文档

README

Installation

composer require mahmoodr786/cakephp-auth0

Load the adaptor in your AppController. Add the code below to your initialize function.

$this->loadComponent('Auth', [
        'storage' => 'Memory',
        'authenticate' => [
                'Form' => [
                        'scope' => ['Users.status' => 1],
                ],
                'Mahmoodr786/AuthZero.Auth0' => [
                        'userModel' => 'Users',
                        'scope' => ['Users.status' => 1],
                        'client_id' => 'CLIENT ID HERE',
                        'secret' => 'SECRET HERE',
                        'fields' => [
                                'username' => 'id',
                        ],
                ],
        ],
        'checkAuthIn' => 'Controller.initialize',
]);

That is it. Send a request to your app with the Authorization Bearer YourAuth0JWTToken header and you should have access to the user in your app.

debug($this->Auth->user());

Google and Facebook

To use Google and Facebook loging set it up using Auth0 add rule to Auth0 and sync the user's credentials in database. Add column to your user table in database called external_id and store the facebook|12323445 or google-oauth2|1234567 id in that field as you get it from Auth0. That should do it.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固