Skip to content

bambrillo/PHPixie-Auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication and Authrization Module for PHPixie

Auth supports logging the user via:

  • Login/Password authentication, passwords are automatically hashed and salted
  • Facebook login

Role drivers allow you to configure roles based on either an ORM relationship or a field in the users table.

To use this module:

Add a config file under /assets/config/auth.php

return array(
    'default' => array(
        'model' => 'user',	//Name of the users table
        'login' => array(
            'password' => array(
                'login_field' => 'username',
                //Must be minimum 50 characters long in database
                'password_field' => 'password',
                'login_token_field' => 'remember_me', //Token that the 'remember me' feature uses
				'login_token_lifetime' => 63072000,	//Amount in seconds the cookie token is valid
            ),
            'facebook' => array(
                //Facebook App ID and Secret
                'app_id' => '138626646318836',
                'app_secret' => '49451a54b61464645321d9fbcb70000',
                //Permissions to request from the user
                'permissions'  => array('user_about_me'),
    			'fbid_field' => 'fb_id',
                //Redirect user here after he logs in
                'return_url' => '/fairies'
            )
        ),
        //Role driver configuration
        'roles' => array(
            'driver' => 'relation',
            'type' => 'has_many',
            //Field in the roles table
            //that holds the models name
            'name_field' => 'name',	//Column for the name of the roles
            'relation' => 'roles'	//Name of the role table
        )
    )
);

About

PHPixie Authentication and Authorization Module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%