2017 © Pedro Peláez
 

library identify

Identify - Complete Authentication System, Session Management and Cryptographic libraries

image

redcatphp/identify

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  • Wednesday, November 30, 2016
  • by surikat
  • Repository
  • 2 Watchers
  • 4 Stars
  • 775 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

No longer actively maintained., (*1)

Identify

Identify is a complete authentication system with session management and cryptographic libraries. It including many third-party library., (*2)

Session

The surikat session handler is independent from native php session and use a strong random id cookie which is regenerated when $cookieLifetime expire. Unlike native php session it allow you to use a session over any length you want, like one year for example, and it integrate an anti-bruteforce system with attempts records based on hashed ip., (*3)

$name = 'redcat';  
$cookieLifetime = 3600; // 1 hour  
$sessionLifetime = 43200;  // 1 year  
$session = new \\RedCat\\Identify\\Session($name,$cookieLifetime,$sessionLifetime);  
if(isset($session['var']))  
    var\_dump( $session['var'] );  
$session['var'] = 'value';  
            

Auth

Here is the main authentication API which you can use with Auth class., (*4)

login

$auth->login($login, $password, $lifetime=0);  
            

loginRoot

$auth->loginRoot($password,$lifetime=0);  
            

loginPersona

$auth->loginPersona($email,$lifetime=0);  
            

register

$auth->register($email, $login, $password, $repeatpassword, $name=null);  
            

activate

$auth->activate($key);  
            

requestReset

$auth->requestReset($email);  
            

logout

$auth->logout();  
            

getHash

$auth->getHash($string, $salt);  
            

getUID

$auth->getUID($login);  
            

getUser

$auth->getUser($uid);  
            

deleteUser

$auth->deleteUser($uid, $password);  
            

validateLogin

$auth->validateLogin($login);  
            

validateDisplayname

$auth->validateDisplayname($login);  
            

resetPass

$auth->resetPass($key, $password, $repeatpassword);  
            

resendActivation

$auth->resendActivation($email);  
            

changePassword

$auth->changePassword($uid, $currpass, $newpass, $repeatnewpass);  
            

getEmail

$auth->getEmail($uid);  
            

changeEmail

$auth->changeEmail($uid, $email, $password);  
            

getRight

$auth->getRight();  
            

setRight

$auth->setRight($r);  
            

connected

$auth->connected();  
            

allowed

$auth->allowed($d);  
            

allow

$auth->allow($d);  
            

deny

$auth->deny($d);  
            

lock

$auth->lock($r,$redirect=true);  
            

AuthServer

First parameter correspond to RedCat\Identify\Auth rights constants. You can use them directly, or if you use string (like in example) it will be automaticaly converted to corresponding constant. The rights constants are Auth::RIGHT_MANAGE, Auth::RIGHT_EDIT, Auth::RIGHT_MODERATE, Auth::RIGHT_POST.
The second parameter (true by default) is for enable GET redirection to avoid re-POST on refresh., (*5)

$authServer = new \\RedCat\\Identify\\AuthServer;  
$authServer->htmlLock('RIGHT\_MANAGE',true);  
            

Following example is for use inside a code (off course with ob-implicit-flush setted to false). It will handle authentication process, from locking with authentication window to logout button ouput. Put the code where you want button to appear., (*6)

$authServer->lougoutBTN();  
            

For handle signup and login process:, (*7)

$authServer->action();  
            

For get identity:, (*8)

$session = $authServer->getSession();  
$identity = $session['\_AUTH\_'];  
            

For handle reset password request:, (*9)

$authServer->resetreq();  
            

For handle reset password confirmation:, (*10)

$authServer->resetpass();  
            

For logout:, (*11)

$authServer->getAuth()->logout()  
            

And, in any context, to get result message:, (*12)

echo $authServer->getResultMessage(true);  
            

PHPMailer

PHPMailer - A full-featured email creation and transfer class for PHP.
PHPMailer is a third party toolbox. See the official PHPMailer and examples. There is simple facade class in RedCat\Identify namespace for use PHPMailer in simplicity:, (*13)

$mailer = new RedCat\\Identify\\PHPMailer(  
    $fromEmail,$fromName,  
    $replyEmail,$replyName,  
    $host,$port,$username,$passowrd,$secure,  
    $sendmail,  
    $debug,$exceptions  
);  
$mailer->mail($email, $subject, $message, $html=true);  
            

RandomLib

RandomLib - A library for generating random numbers and strings.
RandomLib is a third party toolbox. See the official RandomLib, (*14)

SecurityLib

SecurityLib is a third party toolbox (dependency of RandomLib). See the official SecurityLib, (*15)

PhpSecLib

PhpSecLib - PHP Secure Communications Library.
PhpSecLib is a third party cryptography toolbox. See the official PhpSecLib, (*16)

The Versions

30/11 2016

dev-master

9999999-dev http://redcatphp.com/identify-user

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

 

authentication cookie security cryptography session identify bruteforce protection

24/10 2016

v1.6.0

1.6.0.0 http://redcatphp.com/identify-user

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

 

authentication cookie security cryptography session identify bruteforce protection

09/05 2016

v1.5

1.5.0.0 http://redcatphp.com/identify-user

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

 

authentication cookie security cryptography session identify bruteforce protection

08/11 2015

v1.4

1.4.0.0 https://github.com/redcatphp/Identify

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

  • php >=5.4.0

 

authentication cookie security cryptography session identify bruteforce protection

22/10 2015

v1.3

1.3.0.0 https://github.com/surikat/Identify

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

  • php >=5.4.0

 

authentication cookie security cryptography session identify bruteforce protection

14/09 2015

v1.2

1.2.0.0 https://github.com/surikat/Identify

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

  • php >=5.4.0

 

authentication cookie security cryptography session identify bruteforce protection

20/08 2015

v1.1

1.1.0.0 https://github.com/surikat/Identify

Identify - Complete Authentication System, Session Management and Cryptographic libraries

  Sources   Download

LGPL-3.0+ CC0-1.0

The Requires

  • php >=5.4.0

 

authentication cookie security cryptography session identify bruteforce protection