Download the PHP package judasprabin/auth-manager without Composer
On this page you can find all versions of the php package judasprabin/auth-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download judasprabin/auth-manager
More information about judasprabin/auth-manager
Files in judasprabin/auth-manager
Package auth-manager
Short Description Auth0 wrapper for Lumen/Laravel
License MIT
Homepage https://github.com/carsguide/auth-manager
Informations about the package auth-manager
auth-manager
Manages Lumen and Laravel Auth0 integration in microservices using PHP 8.0 version.
Installation
Via composer
Environment settings .env file
Value | What it is |
---|---|
AUTH0_AUDIENCE | Auth0 audience/identifier of the API micro service verifying the token |
AUTH0_OAUTH_URL | Auth0 URL to query to get a token from (the tenant) |
AUTH0_DOMAIN | Auth0 domain of tenant (used during token verifcation) |
AUTH0_JWT_CLIENTID | Auth0 client ID of the micro service getting a token |
AUTH0_JWT_CLIENTSECRET | Auth0 client secret of the micro service getting a token |
AUTH0_ALGORITHM | Algorithm method, advise RS256 (default) |
Registering service provider
Lumen
Add the following snippet to the bootstrap/app.php
file under the register service providers section:
Laravel
Add the following snippet to the config/app.php
file under the register service providers section:
Registering middleware
To use token and scope validation register the middleware via routeMiddleware()
Lumen: bootstrap/app.php
Laravel: app/Http/kernel.php
`
Usage
Generate JWT Token
Using AuthManager
Facade:
Cache JWT token:
Validate JWT Token / Scope Access
Each token is validated via middleware. You must call the middleware in routes or the controller to validate access. The middleware requires a scope be defined, nothing can be global.
Using routes file
All versions of auth-manager with dependencies
illuminate/support Version ^10.0
auth0/auth0-php Version 8.4.0
illuminate/http Version ^10.0
illuminate/cache Version ^10.0
illuminate/container Version ^10.0
illuminate/log Version ^10.0
guzzlehttp/guzzle Version ^7.2
psr/cache Version ^3.0
firebase/php-jwt Version ^6.0
symfony/cache Version ^6.0
einar-hansen/laravel-psr-6-cache Version ^1.0