Download the PHP package denniseilander/laravel-passport-scopes-restriction without Composer

On this page you can find all versions of the php package denniseilander/laravel-passport-scopes-restriction. 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-passport-scopes-restriction

Laravel Passport client scopes restriction

Packagist Version PHP Version Support GitHub Workflow Status (with branch) Total Downloads

This package allows you to limit the scopes a client can request.
By default, Laravel Passport doesn't support restricting scopes per client. Every client can access all available scopes in your project. This package solves that problem.

When to use this package

When your api project contains multiple third party oauth_clients, and you can't control which scopes they request, you may want to limit the scopes a client can request.

Installation

You can install the package via composer:

You can publish and run the migrations with:

Optionally you can publish the config file with:

Usage

After running the migration, you may add specific scopes to each of your oauth_clients allowed_scopes column. You can assign specific scopes the same way as they are assigned to the oauth_access_tokens scopes column:

Every time an access token is requested for a specific client, the allowed_scopes will be added to the scopes column of that token.

You may also add an allowed scope within your POST: passport/oauth request, to specific assign a scope to that access_token:

This will only assign scope-1 to the access_token.

You may leave the scope field empty, which will assign all allowed scopes to the access_token

Syncing existing scopes with new allowed scopes

Sometimes you have your oauth_access_tokens table filled with existing tokens and want to update the scopes because you've changed the allowed_scopes value of a specific client.

This package makes it easy to synchronize exiting token scopes with your allowed scopes by running the following command:

If you've added new scopes to the allowed_scopes column on the clients table, but you want to keep the existing scopes on your tokens, you may add the --keep-existing-scopes flag to the sync command:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-passport-scopes-restriction with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0
laravel/passport Version ^12.0
ext-json Version *
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 denniseilander/laravel-passport-scopes-restriction contains the following files

Loading the files please wait ....