2017 © Pedro Peláez
 

library hybridauth

hybridauth/hybridauth integration for Nette Framework

image

gutter/hybridauth

hybridauth/hybridauth integration for Nette Framework

  • Wednesday, April 18, 2018
  • by kastanekdavid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Gutter\HybridAuth

This is hybridauth/hybridauth integration for Nette Framework., (*1)

Installation

The best way to install Gutter\HybridAuth is via Composer:, (*2)

$ composer require gutter/hybridauth

Usage

You can use the HybridAuth as an extension., (*3)

Configuration

First you have to set the extension up in config.neon., (*4)

extensions:
    hybridAuth: Gutter\HybridAuth\DI\HybridAuthExtension

hybridAuth:
    base_url: https://myapp.com/auth/process
    providers:
        Google:
            enabled: true
            keys:
                id: [your-google-key]
                secret: [your-google-secret]
        Facebook:
            enabled: true
            keys:
                id: [your-facebook-key]
                secret: [your-facebook-secret]
            scope: email

Implementation

Then the implementation of /auth controller could look like this:, (*5)

class AuthPresenter extends BasePresenter
{
    /** @var \Gutter\HybridAuth\Manager @inject */
    public $hybridAuth;

    /** @var AuthModel @inject */
    public $model;

    public function actionProcess()
    {
        $this->hybridAuth->process();
    }

    public function actionGoogle()
    {
        $adapter = $this->hybridAuth->authenticate('Google');
        $userProfile = $adapter->getUserProfile();

        $user = $this->model->getUserByEmail($userProfile->email);
        if ($user) {
            $this->login($user);
        }

        $this->redirect('Login:failed');
    }

    public function actionFacebook()
    {
        $adapter = $this->hybridAuth->authenticate('Facebook');
        $userProfile = $adapter->getUserProfile();

        $user = $this->model->getUserByEmail($userProfile->email);
        if ($user) {
            $this->login($user);
        }

        $this->redirect('Login:failed');
    }
}

The Versions

18/04 2018

dev-master

9999999-dev

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

18/04 2018

v2.0.5

2.0.5.0

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

18/04 2018

v2.0.4

2.0.4.0

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

18/04 2018

v2.0.3

2.0.3.0

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

18/04 2018

v2.0.2

2.0.2.0

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

18/04 2018

v2.0.1

2.0.1.0

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

18/04 2018

v2.0.0

2.0.0.0

hybridauth/hybridauth integration for Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

08/08 2016

v1.0.1

1.0.1.0

hybridauth/hybridauth integration into Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth

26/04 2016

v1.0

1.0.0.0

hybridauth/hybridauth integration into Nette Framework

  Sources   Download

The Requires

 

by David Kaštánek

authentication nette hybridauth