Download the PHP package ely/oauth2-client without Composer

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

Ely.by Provider for OAuth 2.0 Client

This package provides Ely.by OAuth 2.0 support for the PHP League's OAuth 2.0 Client.

Latest Version on Packagist Total Downloads Build Status

Installation

To install, use composer:

Usage

Usage is the same as The League's OAuth client, using \Ely\OAuth2\Client\Provider as the provider. You can find more information in League repository README.

You can get your own clientId and clientSecret at Ely.by Account OAuth2 registration page.

We suggest to put this provider object into service locator for access it at any time or mock for testing. In code below we think, that $provider contains our provider object.

Authorization Code Flow

First of all, you must generate redirect user to route, which will set state session value and redirect user to Ely.by authorization page. This can be done by such code, placed into controller:

Note, that getAuthorizationUrl() takes as argument array of overriding parameters. For example, if you want request additional scopes and change app description, then you must pass scope and description keys with needed values:

After user finish authentication and authorization on Ely.by Account site, he will be redirected back, on redirectUri, that you specified in Provider configuration. Inside redirectUri handler you must check for errors and state matches. If all checks passed normal, then try to exchange received auth_code to access_token. This can be done by code like below:

Refreshing a Token

Refresh tokens are only provided to applications which request offline access. You can specify offline access by setting the scope option on authorization url generating:

It is important to note that the refresh token is only returned on the first request after this it will be null. You should securely store the refresh token when it is returned:

Now you have everything you need to refresh an access token using a refresh token:

Testing

Contributing

Please see CONTRIBUTING for details.

Credits

This package was designed and developed within the Ely.by project team. We also thank all the contributors for their help.

License

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


All versions of oauth2-client with dependencies

PHP Build Version
Package Version
Requires league/oauth2-client Version ^1.0 | ^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 ely/oauth2-client contains the following files

Loading the files please wait ....