2017 © Pedro Peláez
 

library nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

image

vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  • Tuesday, May 27, 2014
  • by vojtechdobes
  • Repository
  • 4 Watchers
  • 37 Stars
  • 2,184 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

For Nette Framework

Allows definition of multiple authentication ways with unified API (for Nette Framework), (*1)

License

New BSD, (*2)

Dependencies

Nette 2.0 or newer, (*3)

Installation

None, really :)., (*4)

Usage

Write your authenticators, but don't make them implement Nette\Security\IAuthenticator. On the other hand, request Nette\Security\User service as dependency., (*5)

class CredentialsAuthenticator
{

    /** @var Nette\Security\User */
    private $user;

    public function __construct(Nette\Security\User $user)
    {
        $this->user = $user;
    }

}

Now write your login method. Be creative!, (*6)

public function login($username, $password)
{
    // ... your logic

    $this->user->login(new Identity( ... ));
}

Register your authenticator as service:, (*7)

services:
    - CredentialsAuthenticator

And you're done., (*8)

For authentication, you should use the specific authenticator:, (*9)

class SignPresenter extends Nette\Application\UI\Presenter
{

    /** @var CredentialsAuthenticator @inject */
    public $credentialsAuthenticator;

    // ...

    public function processLoginForm($form)
    {
        $values = $form->getValues();
        $this->credentialsAuthenticator->login($values->username, $values->password);
    }

}

The point is: use normal dependencies and wrap Nette\Security\User in them, not the other way around., (*10)

The Versions

27/05 2014

dev-master

9999999-dev http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette

27/05 2014

v2.0.0

2.0.0.0 http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette

03/01 2014

v1.0.4

1.0.4.0 http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette

27/12 2013

v1.0.3

1.0.3.0 http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette

04/09 2013

v1.0.2

1.0.2.0 http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette

10/11 2012

v1.0.1

1.0.1.0 http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette

08/11 2012

v1.0.0

1.0.0.0 http://github.com/vojtech-dobes/nette-multi-authenticator

Allows definition of multiple authentication ways with unified API (for Nette Framework).

  Sources   Download

New BSD

The Requires

 

authentication security nette