2017 © Pedro Peláez
 

cakephp-plugin cakephp-auth0

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

image

mahmoodr786/cakephp-auth0

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

  • Sunday, July 9, 2017
  • by mahmoodr786
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

CakePHP Auth0 Adaptor

Installation

composer require mahmoodr786/cakephp-auth0

Load the adaptor in your AppController. Add the code below to your initialize function., (*1)

$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., (*2)

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., (*3)

The Versions

09/07 2017

dev-master

9999999-dev https://github.com/mahmoodr786/cakephp-auth0

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

  Sources   Download

MIT

The Requires

 

authentication cakephp jwt authenticate auth0

09/07 2017

v1.1.0

1.1.0.0 https://github.com/mahmoodr786/cakephp-auth0

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

  Sources   Download

MIT

The Requires

 

authentication cakephp jwt authenticate auth0

20/03 2017

v1.0.0

1.0.0.0 https://github.com/mahmoodr786/cakephp-auth0

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

  Sources   Download

MIT

The Requires

 

authentication cakephp jwt authenticate auth0