PHPackages                             biohivetech/laravel-introspection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. biohivetech/laravel-introspection

Abandoned → [datahivedevelopment/laravel-introspection](/?search=datahivedevelopment%2Flaravel-introspection)ArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

biohivetech/laravel-introspection
=================================

Laravel Introspection - Provides OAuth Introspection capabilities for Laravel Passport

v2.1.0(6y ago)77[2 PRs](https://github.com/DataHiveDevelopment/Laravel-Introspection/pulls)MITPHPPHP ^7.2

Since Nov 30Pushed 5y ago4 watchersCompare

[ Source](https://github.com/DataHiveDevelopment/Laravel-Introspection)[ Packagist](https://packagist.org/packages/biohivetech/laravel-introspection)[ RSS](/packages/biohivetech-laravel-introspection/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (8)Used By (0)

DataHive Development - Laravel Passport Introspection
=====================================================

[](#datahive-development---laravel-passport-introspection)

Heads up
--------

[](#heads-up)

This package has been split into two parts to separate out the components for the authorization and resource servers. This package will remain, probably become archived.

Development builds and documentation are now live! You can find them:

Introduction
============

[](#introduction)

Install this package on **both** your resource and authorization server. Passport should also be installed and configured on your **authorization server**. Passport is a dependency of this package currently so it will get installed on your resource server but you do not need to configure it. Please use the methods outlined in this document in lieu of Passport on your resource servers.

Thanks :)

- [About This Package](#AboutThisPackage)
- [Installing](#Installing)
- [Authorization Server](#AuthorizationServer)
- [Resource Server(s)](#ResourceServers)
- [Protecting Routes](#ProtectingRoutes)
    - [Via Middleware](#Middleware)
    - [Token Scopes](#TokenScopes)
        - [Scopes Middleware](#ScopesMiddleware)
        - [Scope Middleware](#ScopeMiddleware)
- [UUID Setup](#UUIDSetup)
- [A Note on UUIDs](#WhyUUIDs)
    - [Quick Background on DataHive's Usage](#Background)
    - [Overriding](#Overriding)
- [Consuming Your Resource Server's API With JavaScript](#JavaScript)
    - [CSRF Protection](#CSRF)

\# About This Package
-----------------------------------------------------------------

[](#-about-this-package)

This package provides an Introspection controller, authentication guard and middleware needed to allow you to host a separate authorization and resource server.

One package, two functions.

\# Installing
---------------------------------------------------

[](#-installing)

```
composer require datahivedevelopment/laravel-introspection
```

Install the package and the following the appropriate steps below depending on which server you are configuring.

If you want to use UUIDs as a unique identifier for your users across applications, as we do, follow the [UUID Setup](#UUIDSetup). You will perform this setup on the authorization server only!

\# Authorization Server
----------------------------------------------------------------------

[](#-authorization-server)

From

> A server which issues access tokens after successfully authenticating a client and resource owner, and authorizing the request.

This is the server that runs Passport and is your central authority for user information and is responsible for validating access tokens passed to it from the resource servers.

First, if you haven't already, install Passport and perform the standard configuration according to the [official documentation](https://laravel.com/docs/6.x/passport). In our default configuration, you will want to enable the `Client Credentials` grant type. See the Passport documentation's [Client Credentials Grant](https://laravel.com/docs/6.x/passport#client-credentials-grant-tokens) section for instructions on adding the middleware.

Next, you should call the `Introspection::routes` method within the `boot` method of your `AuthServiceProvider` after your `Passport` calls.

`App\Providers\AuthServiceProvider.php`

```
