Download the PHP package diimolabs/laravel-oauth2-client without Composer
On this page you can find all versions of the php package diimolabs/laravel-oauth2-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download diimolabs/laravel-oauth2-client
More information about diimolabs/laravel-oauth2-client
Files in diimolabs/laravel-oauth2-client
Package laravel-oauth2-client
Short Description Package to handle communication with authorization between microservices
License MIT
Informations about the package laravel-oauth2-client
OAuth2 between Laravel projects
A package that allows secure communication between two or more projects, focused mainly for use in microservices architectures, adding the Oauth2 authorization standard in addition to security at the network level by IP addresses and whitelists, which may already be owned.
Features
- Simple implementation
- It does not increase the latency of requests between microservices.
- High level of security
Prerequisites
-
Having an authorization server, it is recommended to use Laravel Passport for this, specifically in the Client Credentials Grant Tokens section
- Store the file
oauth-public.key
at folderstorage/app/
in the microservices to communicate, this file is provided by the authorization server
Installation
-
Import the library
-
Add the following environment variables:
And fill with the data provided by the authorization server when creating the client corresponding to the project
- Implement the
middleware
that validates the authorization of the input requests, in the fileapp/Http/kernel.php
Use
Example of requesting a resource to a microservice
Example of a request from a microservice client
Extra
import the configuration file using:
in external_services
you can manage the urls of your different services