Download the PHP package ikkez/f3-opauth without Composer

On this page you can find all versions of the php package ikkez/f3-opauth. 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 f3-opauth

F3 Opauth Plugin

This is a plugin for easy integration of Opauth for PHP Fat-Free Framework.

Installation

Configuration

  1. You need to configure each strategy you want to use on your service. You can find instructions how to do that in each strategy folder's readme file. Basically you only need to create some OAuth consumer apps on the strategy's provider and add the key/secret credentials to the config file. Google,Facebook,Twitter,and Github are already included here, so you can skip the Install part in their readme files. If you need more OAuth providers, check the the list of strategies.
  2. This plugin comes with its own configuration file. It's used to provide all strategy configuration to Opauth, as well as some F3 routing settings. You should at least change the security_salt and your favorite strategy keys and secrets.
  3. Integrate the authorization into your existing login procedure.

Basic Usage

The event handlers can also be callable string:

To login, call a strategy, i.e.http://domain.com/auth/facebook.

Application flow

  1. Alright, you place a social login button near your regular login form, that send the user to the login strategy, i.e. http://domain.com/auth/facebook.
  2. When a user authenticated to a provider, the user is send back to a callback-route. The callback checks if the request and auth was valid. Then, when the authorization was successful, the onSuccess handler is called and provides you some data from the given strategy.
  3. You can use this data to extract a username, access-token, email or what ever suits best for that strategy. Each strategy provides different data, so depending on your application needs, you perhaps should consider to add some fallback mechanisms into your application (i.e. it can happen that you wont get an email from twitter or facebook). You can use this data to find a match in your user database. Depending on the result you can start your login or registration controller.
  4. On registration, you might want to save that unique-something from the strategy-auth-data to the user table (email, or $f3->hash on multiple fields like username,token,id) - this way you know who has activated a social auth provider and get the chance to load the user based on this.
  5. After registration and on login, you probably save an active user session in your controller to memorize your logged in user.
  6. When the session is expired or the user need to login again from another device, send him to the auth strategy route again (auth/facebook - instant redirect after successful activation on most providers), and now you can find him in your user table with activated social auth and login him in directly.

This is of course just one idea of implementation. Some providers also return tokens for further communication with their 3rd party API (i.e. to fetch more profile data or renew tokens), but that's something this plugin is not going to handle. Have a look at the strategy docs for more information.

Demo

License

GPLv3


All versions of f3-opauth with dependencies

PHP Build Version
Package Version
No informations.
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 ikkez/f3-opauth contains the following files

Loading the files please wait ....