Download the PHP package directlease/auth0 without Composer

On this page you can find all versions of the php package directlease/auth0. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package auth0

Auth0 Authentication for Silverstripe

This a Silverstripe 4 Module for Auth0 that works in combination with the Universal Login. Whether you want to use the 'Classic' or 'New' Universal Login this module works with both.

Read more about the Auth0 Universal Login

Overview

This module adds an additional login to your silverstripe setup which can be used by your users as well as your admins. When you redirect an user to /auth/login (a route provided by this module) the Auth0 SDK will prepare a new login and redirect the user to your auth0 tenant login page (The Universal Login).

On this page an user can either login or register with Auth0 for your application. Once the user has been authenticated by Auth0, he will be redirected to your site to /auth/callback (also provided by this module). The module will check if a user in your site has the same emailaddress as the authenticated Auth0 user and if so perform a login for this user. If no matching user is found in your site then the module will try to fallback to a default user, more about that below.

You can add a 'redirect_to' parameter to the /auth/login url and once the user has been logged-in he will be redirected to that URL. If omitted then the user will be redirected to the homepage.

Default user

You may not want to store information of your users/customers in your site database for various reasons (GDPR, Potential security risk in case of a hack, etc).
But you do want to restrict access to (parts) of your application from the public. For this purpose we have decided to add a default user login.

A default user is a member object with a fixed e-mail address, no password and fixed permissions for this member. This member object will be used by every user of your site, besides admins.

You can retrieve all the info of the user from auth0 and assign it to the default member. This information will then be stored in the session instead of being stored in the database. Once the user leaves the site the session will be destroyed and his information is no longer in your (company's) possession.

If your site uses different groups and permissions for users then this use-case is not for you. Support for multiple default users is needed then, is not on the roadmap.

Routes

The following routes can be used with this module

Installation

composer require directlease/auth0

Config

You can put your auth0 information in your site config file. You can find all required config settings here

Example site config file

The following config settings are required:

The following config settings are optional based on your implementation:

Minimal setup steps for login

We only cover what is needed to get the module to work, Auth0 allows you to configure so much more.

User Management

You need to configure the Management API for your tenant and give it the correct scopes for the non-interactive-client in Auth0. The Management API is used in the 'updateToAuth0' function in the Auth0ApiController.

You need to configure the Allowed Logout URLs in your tenant settings to make the logout function work.

V4 updates

Redirecting post login: send the user to the login url (/auth/login) and append ?redirect_to= with your desired URL. It can be a local url then you just pass /home or /welcome or external https://www.github.com

if you want to use the verification email and other functions that require tokens You must create an Machine to Machine (M2M) Application in your Auth0 Tenant And enable the Management API on that application with the correct scopes.


All versions of auth0 with dependencies

PHP Build Version
Package Version
Requires silverstripe/framework Version ^4 || ^5
silverstripe/versioned Version ^1 || ^2
silverstripe/vendor-plugin Version ^1 || ^2
auth0/auth0-php Version ^8
guzzlehttp/guzzle Version ^7
ext-json Version *
tractorcow/silverstripe-fluent Version ^5||^6||^7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package directlease/auth0 contains the following files

Loading the files please wait ....