Download the PHP package faithfm/laravel-simple-auth0 without Composer

On this page you can find all versions of the php package faithfm/laravel-simple-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 laravel-simple-auth0

laravel-simple-auth0

A simple/lightweight way to integrate Auth0 into your Laravel Application:

This library was developed after spending a many hours re-integrating our Laravel apps with each major update of Auth0's official Laravel SDK (auth0/login package). Our applications are stateful "PHP Web Applications" (rather than stateless "PHP Backend APIs" interfacing to an SPA with JWTs), and we did not need a lot of the advanced features included in the Laravel SDK, so we decided to develop a simple package based around the Auth0 QuickStart for a simple PHP Web Application.

If you would like a simple way to integrate Auth0 with Laravel but would prefer not to use this library, you can simply clone our three controllers, register these routes manually, and customise them to your hearts content. You'll soon see that

Installation:

Assuming you have a standard Laravel application (with the default 'session' driver in config/auth.php), you can add this package using composer and run the database migration to prepare the users table for Auth0 (vs password-based) logins.

[!NOTE]

In modifying the users table, the published migration adds the sub field, drops the unique constraint on the email field, and drops the password and email_verified fields. if your users field contains existing user/password entries you with to retain, you should modify the default migration to retain your existing fields.

Modify Models\User.php to reflect these changes:

Configuration:

  1. Create a "Regular Web Application" in your Auth0 Dashboard, and configure the allowed Callback + Logout URLs as required. (See Laravel Auth0 SDK docs for more details)
  2. Use these details to configure your .env file, replacing them with your own credentials:

  3. Add the following lines to your web.php file:

Basic Usage:

You can now use any of Laravel's normal authentication methods to check if logged in, protect routes, retrieve a user, etc:

Don't forget, Authentication (AuthN) is about knowing who is using a system. Whether or not a user has permission to use the system is a separate topic referred to as Authorization (AuthZ) - see Laravel Authorization documentation.

For a simple table/model-based approach to user permissions / Authorization you might like to try our Laravel Simple Permissions package.

[!NOTE]

These packages are both part of our overall AuthN/AuthZ pattern that we deploy for our apps. (Our Faith FM Laravel Auth0 Pattern package is more opinionated than the underlying packages, and includes a number of published template files that may be less helpful for a wider audience, but you're welcome to use them if they are helpful.)

How it works:

Three routes are registered: /login, /logout, /callback

[!IMPORTANT]

This route seeks to capture the 'previous' URL as the 'intended' URL for the callback to redirect to after a successful login


All versions of laravel-simple-auth0 with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0
illuminate/support Version >8.0
laravel/framework Version >8.0
auth0/auth0-php Version >7.0
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 faithfm/laravel-simple-auth0 contains the following files

Loading the files please wait ....