PHPackages                             org\_heigl/hybridauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. org\_heigl/hybridauth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

org\_heigl/hybridauth
=====================

Lightweight Authentication Module for Zend-Framework 2 using the hybridauth-library

3.0.0(9y ago)211.9k8[1 issues](https://github.com/heiglandreas/HybridAuth/issues)[1 PRs](https://github.com/heiglandreas/HybridAuth/pulls)MITPHPPHP ^5.6 || ^7.0

Since May 20Pushed 7y ago4 watchersCompare

[ Source](https://github.com/heiglandreas/HybridAuth)[ Packagist](https://packagist.org/packages/org_heigl/hybridauth)[ Docs](http://github.com/heiglandreas/HybridAuth)[ RSS](/packages/org-heigl-hybridauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (13)Used By (0)

OrgHeiglHybridAuth
==================

[](#orgheiglhybridauth)

[![Join the chat at https://gitter.im/heiglandreas/HybridAuth](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/heiglandreas/HybridAuth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://camo.githubusercontent.com/a8fe2d1ebfa9f20bd6e04f12414d4f954a50af9ccecae886daef06d16a044314/68747470733a2f2f7472617669732d63692e6f72672f686569676c616e64726561732f487962726964417574682e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/heiglandreas/HybridAuth)[![Code Climate](https://camo.githubusercontent.com/f784a1b74257282e7307a6afe3fb1ac625b1e963505b73202816ca7cc57bf748/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f686569676c616e64726561732f487962726964417574682f6261646765732f6770612e737667)](https://codeclimate.com/github/heiglandreas/HybridAuth)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c8d50ca4043f20bab41e417682e3db368e578dd88693d4e3ac2551ade3e2e219/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686569676c616e64726561732f487962726964417574682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/heiglandreas/HybridAuth/?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/5282046ac53e402651d921218b39aa2ace95f6587ee18b3733c70e9f4aedfc03/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6639386263383062616366663433326238316437643365653834323438393031)](https://www.codacy.com/app/github_70/HybridAuth?utm_source=github.com&utm_medium=referral&utm_content=heiglandreas/HybridAuth&utm_campaign=Badge_Grade)[![Coverage Status](https://camo.githubusercontent.com/9b7bb3fd23d19a0eb2fafa544945cd03de09ee99cbb543a702f11c7b407cb265/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f686569676c616e64726561732f487962726964417574682f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/heiglandreas/HybridAuth?branch=master)

[![Dependency Status](https://camo.githubusercontent.com/5a8537dd8a1ffe624636e8548eb87db8a7c8cb4f3b24bad7e6027b4431ddd60d/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3538613331636365393430623233303033363736383737342f62616467652e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/58a31cce940b230036768774)[![Total Downloads](https://camo.githubusercontent.com/f6f66f66370b2e1129a9d56ce4cc99b22a53cb76231848a2c68093af0973df60/68747470733a2f2f706f7365722e707567782e6f72672f6f72675f686569676c2f687962726964617574682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/org_heigl/hybridauth)[![Latest Stable Version](https://camo.githubusercontent.com/12918ad19bfd2d9e67a041c5dade39971585c416156151c20a1051a685b87200/68747470733a2f2f706f7365722e707567782e6f72672f6f72675f686569676c2f687962726964617574682f762f737461626c652e706e67)](https://packagist.org/packages/org_heigl/hybridauth)[![Stories in Ready](https://camo.githubusercontent.com/d111d0a129eff05fcbf37f03ac73d0071fa40a4fd5333c2f6969fdef4c3d6b83/68747470733a2f2f62616467652e776166666c652e696f2f686569676c616e64726561732f487962726964417574682e706e673f6c6162656c3d7265616479)](https://waffle.io/heiglandreas/HybridAuth)

Use the SocialConnect-Library to create an absolute lightweight Authentication-Layer for your ZendFramework3-App

You can login with all [supported SocialNetwork-Logins](https://github.com/SocialConnect/auth). The network and a user-object holding id, name, mail and language will be stored in the session. If you already have SocialNetwork users in your application you can use these to authorize your users.

Requirements
------------

[](#requirements)

- The [SocialConnect-Library](https://github.com/SocialConnect/auth). This lib uses the version 3 which is not (yet) stable!
- Zend Framework3 (well, obvious, isn't it?)

Usage
-----

[](#usage)

1. In your application.conf-file add the Module to the list of modules
2. Copy the file `vendor/org_heigl/hybridauth/config/autoload/module-orgHeiglHybridAuth.local.php` to your applications `config/autoload`-directory and adapt as appropriate. That might look like this:

    ```
    return [
        'OrgHeiglHybridAuth' => [
            'socialAuth' => [
                'redirectUri' => 'http://localhost:8080/authenticate/backend',
                'provider' => [
                    'twitter' => [
                        'applicationId' => '',
                        'applicationSecret' => '',
                        'scope' => ['email'],
                    ],
                    'github' => [
                        'applicationId' => '',
                        'applicationSecret' => '',
                        'scope' => ['email'],
                    ],
                ],
            ],
            'session_name' => 'orgheiglhybridauth',
            'backend'         => array('Twitter'), // could also be ['Twitter', 'Facebook']
            // 'link'            => '%1$s', // Will be either inserted as first parameter into item or simply returned as complete entry
            // 'item'            => '%1$s',
            // 'itemlist'        => '%1$s',
            // 'logincontainer'  => '%1$s%2$s',
            // 'logoffcontainer' => '%1$s',
            // 'logoffstring'    => 'Logout %1$s',
            // 'loginstring'     => 'Login%1$s',
            // 'listAttribs'     => null, // Will be inserted as 2nd parameter into item
            // 'itemAttribs'     => null, // Will be inserted as 2nd parameter into itemlist
        ]
    ];
    ```
3. Add this snippet to create a login-link

    ```

    ```
4. After login you can access the user-info the following way:

    ```
    $config = $this->getServiceLocator()->get('Config');
    $config = $config['OrgHeiglHybridAuth'];
    $hybridAuth = new Hybridauth($config['hybrid_auth']);

    $token = $this->getServiceLocator()->get('OrgHeiglHybridAuthToken');
    if (! $token->isAuthenticated()) {
        echo 'No user logged in';
    }
    /** @var OrgHeiglHybridAuth\UserToken $user */
    echo $token->getDisplayName(); // The name of the logged in user
    echo $token->getUID();  // The internal UID of the used service
    echo $token->getMail(); // The mail-address the service provides
    echo $token->getLanguage(); // The language the service provides for the user
    echo $token->getService()  // Should print out the Name of the service provider.
    ```

Installation
------------

[](#installation)

### composer

[](#composer)

This module is best installed using [composer](http://packagist.org/packages/org_heigl/hybridauth). For that, run the following command to add the library to your app:

```
# Require the hybridauth-module
composer require org_heigl/hybridauth

```

If you want to use more than one authentication-provider you should instead run this:

```
# Require the hybridauth-module
composer require org_heigl/hybridauth:dev-feature/multipleProviders

```

### Manual installation

[](#manual-installation)

So you want it the hard way? Sure you don't want to give composer a try?

Then go figure it out. You might want to ask on the gitter channel or on IRC (freenode) but expect a reply along the line "use composer!"

Note that you can either download the zip-files of the libraries or use the git submodule command to clone the libs into the appropriate folders. You should **not** simply use `git clone  ` as that might interfere with your local git-repo (when you use one). The submodule approach makes Lib-updates easier bun can end in a lot of headaches due to the caveats of the submodule-command! I can not provide you with support in that case! Alternatively you can fork the project at [github](https://github.com/heiglandreas/OrgHeiglHybridAuth).

### Example Implementation.

[](#example-implementation)

There is an example-implementation at  - The sourcecode is on github.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 74.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~204 days

Recently: every ~70 days

Total

7

Last Release

3380d ago

Major Versions

1.0.2 → 2.0.02016-05-10

1.0.4 → 3.0.02017-02-15

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

3.0.0PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ae5183aaad2bc7453230704bd6991dc6ccbcd6e775c6a29efdc94350a69f247?d=identicon)[heiglandreas](/maintainers/heiglandreas)

---

Top Contributors

[![heiglandreas](https://avatars.githubusercontent.com/u/91998?v=4)](https://github.com/heiglandreas "heiglandreas (86 commits)")[![aripringle](https://avatars.githubusercontent.com/u/1278449?v=4)](https://github.com/aripringle "aripringle (14 commits)")[![Voronchuk](https://avatars.githubusercontent.com/u/414573?v=4)](https://github.com/Voronchuk "Voronchuk (6 commits)")[![jaydiablo](https://avatars.githubusercontent.com/u/136907?v=4)](https://github.com/jaydiablo "jaydiablo (5 commits)")[![newage](https://avatars.githubusercontent.com/u/426997?v=4)](https://github.com/newage "newage (2 commits)")[![Dexus](https://avatars.githubusercontent.com/u/1674289?v=4)](https://github.com/Dexus "Dexus (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

facebookusergithubtwittermoduleloginzf2social network

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/org-heigl-hybridauth/health.svg)

```
[![Health](https://phpackages.com/badges/org-heigl-hybridauth/health.svg)](https://phpackages.com/packages/org-heigl-hybridauth)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[socialconnect/auth

Social Connect Auth Component

568845.4k5](/packages/socialconnect-auth)[socalnick/scn-social-auth

Uses the HybridAuth PHP library to Enable authentication via Google, Facebook, Twitter, Yahoo!, etc for the ZfcUser ZF2 module.

21974.2k3](/packages/socalnick-scn-social-auth)[zf-commons/zfc-user

A generic user registration and authentication module for ZF2. Supports Zend\\Db and Doctrine2.

4851.1M70](/packages/zf-commons-zfc-user)[crada/phalcon-user-plugin

User plugin for Phalcon PHP framework

1832.5k1](/packages/crada-phalcon-user-plugin)[fof/oauth

Allow users to log in with GitHub, Facebook, Google, Discord, GitLab, LinkedIn, and more!

50118.7k41](/packages/fof-oauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
