Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't login using Community Auth in Codeigniter

I've been following on how to install the Community Auth to codeigniter. I followed the instructions in the installation guide:

15 Create a user for testing purposes by editing the user_data array that is inside the create_user method, which is in the Examples controller. When specifying a user level, be aware of the “levels_and_roles” array located in config/authentication. In order to login in the next step the user level must be set to 9, which by default is an admin. Also note that this method of user creation does not account for password strength, yet the login validation does. A password that is strong enough will have an uppercase letter, a number, and be at least 8 characters long. Run /examples/create_user in your browser to create the user.

However, I can't still login to it. It says that LOGIN ERROR: Invalid Username, Email Address, or Password., always.

I already changed these:

            $user_data = array(
            'user_name'     => 'admin',
            'user_pass'     => 'admiN123',
            'user_email'    => '[email protected]',
            'user_level'    => '9', // 9 if you want to login @ examples/index.
        );

and use it to login but login error again and again.

like image 892
kmf Avatar asked Apr 29 '26 19:04

kmf


2 Answers

Please activate the debugging information:

Open up /application/config/config.php. Find the log_threshold setting and change it to 2 or greater. 2 is the lowest level that allows for debug level error messages to be logged, and this is the level that Community Auth uses.

$config['log_threshold'] = 2;

Read more on http://community-auth.com/documentation/debugging

like image 181
ponsfrilus Avatar answered May 01 '26 08:05

ponsfrilus


I noticed, from using the debug, that my database password did not match the posted password.

When I had set my system up, I had not set up the $config['encryption_key'] correctly. So the fix was a simple as un-commenting the encryption_key...not sure why it was commented out to begin with.

The end fix was to set up my /config/config.php file to be:

 $config['encryption_key'] = '';
like image 23
DanielJRobles Avatar answered May 01 '26 09:05

DanielJRobles