Download the PHP package league/oauth2-facebook without Composer

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

Facebook Provider for OAuth 2.0 Client

Build Status Latest Stable Version

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

This package is compliant with PSR-1, PSR-2, PSR-4, and PSR-7. If you notice compliance oversights, please send a patch via pull request.

Requirements

The following versions of PHP are supported.

Installation

Add the following to your composer.json file.

Usage

Authorization Code Flow

The FacebookUser Entity

When using the getResourceOwner() method to obtain the user node, it will be returned as a FacebookUser entity.

You can also get all the data from the User node as a plain-old PHP array with toArray().

Graph API Version

The graphApiVersion option is required. If it is not set, an \InvalidArgumentException will be thrown.

Each version of the Graph API has breaking changes from one version to the next. This package no longer supports a fallback to a default Graph version since your app might break when the fallback Graph version is updated.

See the Graph API version schedule for more info.

Beta Tier

Facebook has a beta tier that contains the latest deployments before they are rolled out to production. To enable the beta tier, set the enableBetaTier option to true.

Refreshing a Token

Facebook does not support refreshing tokens. In order to get a new "refreshed" token, you must send the user through the login-with-Facebook process again.

From the Facebook documentation:

Once [the access tokens] expire, your app must send the user through the login flow again to generate a new short-lived token.

The following code will throw a League\OAuth2\Client\Provider\Exception\FacebookProviderException.

Long-lived Access Tokens

Facebook will allow you to extend the lifetime of an access token by exchanging a short-lives access token with a long-lived access token.

Once you obtain a short-lived (default) access token, you can exchange it for a long-lived one.

Getting Additional Data

Once you've obtained a user access token you can make additional requests to the Graph API using your favorite HTTP client to send the requests. For this example, we'll just use PHP's built-in file_get_contents() as our HTTP client to grab 5 events from the the authenticated user.

See more about:

If you need to make even more complex queries to the Graph API to get lots of data back with just one request, check out the Facebook Query Builder.

Testing

Contributing

Please see CONTRIBUTING for details.

Credits

License

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


All versions of oauth2-facebook with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
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 league/oauth2-facebook contains the following files

Loading the files please wait ....