Download the PHP package marketredesign/mrd-auth0-laravel without Composer

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

MRD Auth0 Laravel

Latest Version on Packagist Build Status Code Coverage Total Downloads

Wrapper to easily configure Auth0 with a Laravel application.

Also includes a logger for NewRelic.

Getting Started

Prerequisites

Installing

You can install the package via composer:

For configuration, the default config files can be published using the following command.

Select the option for Marketredesign\MrdAuth0Laravel\MrdAuth0LaravelServiceProvider. This creates the config file config/mrd-auth0.php.

Upgrade to v2

See the UPGRADE guide for instructions when updating an application that uses v1 to v2.

Usage

See laravel-auth0 for instructions on how to configure authentication / authorization of users.

Authorizing dataset access

Add the dataset.access middleware to the API route. Then, make sure the dataset ID is specified using either dataset_id or datasetId. It can be part of the route itself or part of the request data (query param, request body, etc.)

Requesting machine-to-machine tokens from Auth0

Use Auth0 facade. Can be used to retrieve a machine-to-machine token, only when running in console (e.g. from async job). The tokens are automatically cached for half their expiration time. When testing a function that retrieves a m2m token, execute Auth0::fake() to use a mocked Auth0Repository which does not make any API calls to Auth0. The fake repository can be influenced using the Auth0::fake...() functions.

User repository

Use Users facade. Can be used to retrieve a single user, or multiple users, by ID. Also includes functionality to retrieve multiple users by email addresses. When testing a function that uses the UserRepository (or Facade), execute Users::fake() to use a mocked UserRepository which does not make any API calls to Auth0. The fake repository can be influenced using Users::fake...() methods.

Dataset repository

Use Datasets facade. Can be used to retrieve authorized datasets for the current user making the API request. When testing a function that uses the DatasetRepository (or Datasets facade), execute Datasets::fake() to use a mocked version of the DatasetRepository that does not make any API calls to the underlying user tool API. The fake repository can be influenced using the Datasets::fake...() methods.

Logging to NewRelic

Create a new logger in the config/logging.php file (example code below) and make sure that the NEWRELIC_LICENSE_KEY is set. Then, this logger can be selected as any other logger, for example by setting the LOG_CHANNEL to 'newrelic'.

This logger looks for optional app.repository and app.version config values to log along with every logged message, so add those fields to the config/app.php file if you want this to be included.

Example code Logger for in `config/logging.php`: Optional `app.repository` and `app.version` config values for in `config/app.php`:

Running the tests

Simply run:

Authors

See also the list of contributors who participated in this project.

License

The MIT License (MIT). Please see License File for more information.


All versions of mrd-auth0-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
auth0/auth0-php Version ^8.3
auth0/login Version ~7.7.0
guzzlehttp/guzzle Version ^6.0|^7.0
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0
newrelic/monolog-enricher Version ^2.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 marketredesign/mrd-auth0-laravel contains the following files

Loading the files please wait ....