Download the PHP package macsidigital/laravel-oauth2-client without Composer

On this page you can find all versions of the php package macsidigital/laravel-oauth2-client. 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-oauth2-client

Laravel OAuth2 Client

Laravel package for OAuth 2 Client Authentication

Header Image

tests badge version badge downloads badge

A little OAuth2 Client Authentication Library

Support us

We invest a lot in creating open source packages, and would be grateful for a sponsor if you make money from your product that uses them.

Installation

You can install the package via composer:

Package helper

The package helper can be used to return the package version

Usage

The main aim of this library is to handle the authentication requirements of OAuth2. Then you should have a token which you can use in an API client.

There are Token Drivers for both File and Database.

File

The file driver will save a file in storage/app/oauth2, which will keep the token details required to communicate with the OAuth2 Server.

Database

Config

If you want to use the DB driver and would like to customise teh table name then you can publish the config file and amend the table_name column

Migrations

If using DB driver you will need to publish migrations.

Then you will need to run migrations

Integration Configuration

The majority of the setup can be found in the config file, which needs to be copied and placed in the laravel config directory

(Todo: Create a command to automatically publish the config file)

As the primary focus of the library is in packages, this needs to be loaded into laravel with an integration name through a service provider. So for xero:-

You also need to check the credential requirements for the oauth2 server and add to config as required.

Authorising & the AuthorisationProcessor

There are routes pre-defined to connect to the Oauth2 server, the named routes are 'oauth2.authorise' & 'oauth2.callback' and both need passing in the integration. So for xero:-

If you are using a simple straight forward Server and if all setup is done correctly we should be linking the account in no time.

However, some API's will have custom processing requirements, for example Xero needs a tenant id.

In these cases we need to create a custom AuthorisationProcessor, which is passed the League/Oauth2-client AccessToken and the integration name so that the config can be pulled.

So this is how it would look for Xero:-

Now our access token etc are saved we should be able to use the macsidigital/laravel-api-client to communicate with OAuth2 API's, of course each API will be different so you need to check documentation. Here is an example of how we would use the stored details to communicate with Xero API.

Testing

ToDo

Basically we are just defining how we can authorise and communicate with the API. For more details on what this means check the documentation for laravel-api-client.

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of laravel-oauth2-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0|^8.1
nesbot/carbon Version ^1.26.3 || ^2.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0
league/oauth2-client Version ^2.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 macsidigital/laravel-oauth2-client contains the following files

Loading the files please wait ....