Download the PHP package xcoorp/laravel-passport-introspection without Composer

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

Introduction

Laravel Passport Introspection is a Laravel Passport addition that provides an introspection endpoint for your Laravel application. This is useful if you want to introspect tokens in your application, e.g. to check if a token is still valid or to get information about the token.

You will typically need this if you set up a separate resource server that is meant to authenticate against an Authentication Server running Laravel Passport. To setup a resource server, you can check out the Passport Control Package.

Table of Contents

Installation

[!IMPORTANT] This package assumes you have already installed and configured Laravel Passport in your Laravel application.

You can simply install the package via composer:

After the installation you need to add the introspect scope to the configured passport scopes. If you haven't already defined scopes or do not know how to do this, please refer to the official Laravel Passport documentation.

Usage

Once you have installed the package, a new Route will be available at /oauth/introspect that you can use to introspect tokens. Please note that the introspection endpoint is not meant to be publicly accessible since it can leak sensitive information about your tokens. Therefore, this package makes use of the client credentials grant to authenticate the request. More information on what this is and how to create a client credentials grant client can be found in the official Laravel Passport documentation.

Once you have created a client credentials grant client, and received an access token for it, you can use the token to authenticate against the introspection endpoint via Bearer Authentication. The endpoint expects a POST request with the following inside the request body (application/x-www-form-urlencoded):

Parameter Value
token The token you want to introspect.
token_type_hint (optional) The type of token you want to introspect. This can be either access_token or refresh_token. If you do not provide this parameter, the endpoint will try to introspect the token as an access token.

The endpoint will return a JSON response with the following parameters:

Key Value
active A boolean indicating whether the token is active or not
scope A JSON string containing a space-separated list of scopes associated with this token
client_id The client id of the client that requested this token.
username The unique identifier of the user that requested this token
exp Integer timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire

If you want to customize the Route or the Controller that handles the introspection request, you can disable route publishing of this package and create your own route and controller. You can do this by adding the following line to the boot method of your AppServiceProvider:

Testing

Functionality of this package is tested with Pest PHP. You can run the tests with:

Code of Conduct

In order to ensure that the community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

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

License

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


All versions of laravel-passport-introspection with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3 || ^8.4
illuminate/support Version ^11.0 || ^12.0
illuminate/routing Version ^11.0 || ^12.0
laravel/framework Version ^11.0 || ^12.0
laravel/passport Version ^13.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 xcoorp/laravel-passport-introspection contains the following files

Loading the files please wait ....