Download the PHP package admad/cakephp-hybridauth without Composer

On this page you can find all versions of the php package admad/cakephp-hybridauth. 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 cakephp-hybridauth

If you are using CakePHP 3.4+ checkout my ADmad/cakephp-social-auth instead.

CakePHP HybridAuth Plugin

Total Downloads

A CakePHP plugin which allows using the HybridAuth social sign on library.

Requirements

Installation

Run:

Setup

Load the plugin by running following command in terminal:

or by manually adding following line to your app's config/bootstrap.php:

Configuration

Make a config file config/hybridauth.php:

For more information about the hybridauth configuration array check http://hybridauth.github.io/hybridauth/userguide/Configuration.html

Database

The plugin expects that you have a users table with at least email field and a social_profiles table. You can run

to generate the social_profiles tabel using a migration file provided with the plugin.

Usage

Check the CakePHP manual on how to configure and use the AuthComponent with required authentication handler. You would have something like this in your AppController's initialize() method.

Note: When specifying loginRedirect and loginAction URLs for AuthComponent be sure to add 'plugin' => false (or appropiate plugin name) to the URL array.

Your controller's login action should be similar to this:

Note: When your action calls $this->Auth->identify() the method may not return. The authenticator may need to redirect to the provider's site to complete the identification procedure. It's important not to implement any important business logic that depends upon the identify() method returning.

On your login page you can create links to initiate authentication using required providers. Specify the provider name using variable named provider in query string.

We use a POST link here instead of a normal link to prevent search bots and other crawlers from following the link. (Adding "nofollow" attribute to link doesn't suffice as it's often ignored by bots/crawlers.)

Once a user is authenticated through the provider the authenticator gets the user profile from the identity provider and using that tries to find the corresponding user record in your app's users table. If no user is found emits a HybridAuth.newUser event. You must setup a listener for this event which save new user record to your users table and return an entity for the new user. Here's how you can setup a method of your UsersTable as callback for the event.

If you also want to monitor all logins - and execute e.g. a login counter - you can listen for the HybridAuth.login event.

Additionally, you can also get a flash message for login back using the HybridAuth.login event:

Twitter & email addresses

If you are trying to achieve a 'Sign in using Twitter' functionality, and you require the users email address, you need to specifically get your application white-listed by Twitter Support using this form and selecting 'I need access to special permissions'. Then you can use the 'includeEmail' => true configuration option.

Copyright

Copyright 2016 ADmad

License

See LICENSE


All versions of cakephp-hybridauth with dependencies

PHP Build Version
Package Version
Requires cakephp/cakephp Version ~3.1
hybridauth/hybridauth Version ^2.9.1
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 admad/cakephp-hybridauth contains the following files

Loading the files please wait ....