PHPackages                             doris-adv/yii2-eauth - 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. doris-adv/yii2-eauth

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

doris-adv/yii2-eauth
====================

2.5.0(9y ago)01New BSD LicensePHPPHP &gt;=5.4.0

Since Sep 3Pushed 4y agoCompare

[ Source](https://github.com/doris-adv/yii2-eauth)[ Packagist](https://packagist.org/packages/doris-adv/yii2-eauth)[ Docs](https://github.com/Nodge/yii2-eauth)[ RSS](/packages/doris-adv-yii2-eauth/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (18)Used By (0)

Yii2 EAuth extension
====================

[](#yii2-eauth-extension)

EAuth extension allows to authenticate users with accounts on other websites. Supported protocols: OpenID, OAuth 1.0 and OAuth 2.0.

EAuth is an extension to provide a unified (does not depend on the selected service) method to authenticate the user. The extension itself does not perform login, does not register the user and does not bind the user accounts from different providers.

- [Demo](http://nodge.ru/yii-eauth/demo2/)
- [Demo project](https://github.com/Nodge/yii2-eauth-demo/)
- [Installation](#installation)
- [Version for yii 1.1](https://github.com/Nodge/yii-eauth/)

### Why own extension and not a third-party service?

[](#why-own-extension-and-not-a-third-party-service)

The implementation of the authorization on your own server has several advantages:

- Full control over the process: What will be written in the authorization window, what data we get, etc.
- Ability to change the appearance of the widget.
- When logging in via OAuth, it is possible to invoke methods on the API.
- Fewer dependencies on third-party services - more reliable application.

### The extension allows you to:

[](#the-extension-allows-you-to)

- Ignore the nuances of authorization through the different types of services and use the class based adapters for each service.
- Get a unique user ID that can be used to register the user in your application.
- Extend the standard authorization classes to obtain additional data about the user.
- Work with the API of social networks by extending the authorization classes.
- Set up a list of supported services, customize the appearance of the widget, use the popup window without closing your application.

### Extension includes:

[](#extension-includes)

- The component that contains utility functions.
- A widget that displays a list of services in the form of icons and allowing authorization in the popup window.
- Base classes to create your own services.
- Ready to authenticate via Google, Twitter, Facebook and other providers.

### Included services:

[](#included-services)

- OpenID:
    - Yahoo
    - Steam
- OAuth1:
    - Twitter
    - LinkedIn
- OAuth2:
    - Google
    - Facebook
    - Live
    - GitHub
    - LinkedIn
    - Instagram
    - Yandex (ru)
    - VKontake (ru)
    - Mail.ru (ru)
    - Odnoklassniki (ru)

### Resources

[](#resources)

- [Yii EAuth](https://github.com/Nodge/yii2-eauth)
- [Demo](http://nodge.ru/yii-eauth/demo2/)
- [Demo project](https://github.com/Nodge/yii2-eauth-demo/)
- [Yii Framework](http://yiiframework.com/)
- [OpenID](http://openid.net/)
- [OAuth](http://oauth.net/)
- [OAuth 2.0](http://oauth.net/2/)
- [LightOpenID](https://github.com/iignatov/LightOpenID)
- [PHPoAuthLib](https://github.com/Lusitanian/PHPoAuthLib)

### Requirements

[](#requirements)

- Yii 2.0 or above
- curl php extension
- LightOpenId
- PHPoAuthLib

Installation
============

[](#installation)

This library can be found on [Packagist](https://packagist.org/packages/nodge/yii2-eauth). The recommended way to install this is through [composer](http://getcomposer.org).

Edit your `composer.json` and add:

```
{
		"require": {
				"nodge/yii2-eauth": "~2.0"
		}
}
```

And install dependencies:

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
```

Usage
=====

[](#usage)

Demo project
------------

[](#demo-project)

The source code of the [demo](http://nodge.ru/yii-eauth/demo2/) is available [here](https://github.com/Nodge/yii2-eauth-demo/).

Basic setup
-----------

[](#basic-setup)

### Configuration

[](#configuration)

Add the following in your config:

```
