Welcome Guest, Not a member yet? Register   Sign In
Community_Auth login or setup problem
#1

(This post was last modified: 12-05-2017, 09:25 PM by JeffreyB. Edit Reason: More info )

I would like to think I have a botched installation of Community_Auth, except some things are working. For my limited skills this is quite a program to troubleshoot. The author has obviously done a ton of work.

1)I can't get the login page using any of: a)index.php/examples/index or b)index.php/examples or c}index.php/examples/login

2) I DO get a page using: index.php/examples/recover

3) At that recover page I get menu options and links for:
- Login
- Ajax login
- Optional Login
- Simple verification
- Create User

All of these lead to pages, EXCEPT for the Login link. On clicking on that link, I get a 404 error which shows in the location bar as: /index.php/login?redirect=examples%2Foptional_login_test

4) This is similar to the link for the Login on that page which on a mouseover shows as: index.php/login?redirect=examples

5) The CI log file tells me everything is loading okay, except for the session path not being set, and sending a message the CI log file as:
Session: "sess_save_path" is empty; using "session.save_path" value from php.ini.

6) I created the user 'skunkbot' following the install instructions. On the recover page, when I try to 'Create User' I get a new page that says 'User Creation Error - Username already in use'

'Simple Verification' returns "nobody logged in."
'Optional Login' returns page "You are not logged in but can still see this page." Login from this page returns 404 error: /index.php/login?redirect=examples%2Foptional_login_test

7) This is the last line from the CI log file when using /index.php/examples/index:

ERROR - 2017-12-06 02:16:52 --> 404 Page Not Found: Login/index

8) I added a couple more routes, but that didnt help.

So, any thoughts on what did I do or miss that was really silly?

PS I dont think it is relevant, but just in case:
localhost on xampp with mariadb - according to the xampp documentation anyway Smile
Reply
#2

Here is the CI log I get when starting up at /index.php/examples  I changed the sess_driver to 'database' and sess_save_path to 'ci_sessions' with the same results as before except you can see the session result in the info below.

INFO - 2017-12-06 17:05:45 --> Config Class Initialized
INFO - 2017-12-06 17:05:45 --> Hooks Class Initialized
DEBUG - 2017-12-06 17:05:45 --> UTF-8 Support Enabled
INFO - 2017-12-06 17:05:45 --> Utf8 Class Initialized
INFO - 2017-12-06 17:05:45 --> URI Class Initialized
INFO - 2017-12-06 17:05:45 --> Router Class Initialized
INFO - 2017-12-06 17:05:45 --> Output Class Initialized
INFO - 2017-12-06 17:05:45 --> Security Class Initialized
DEBUG - 2017-12-06 17:05:45 --> Global POST, GET and COOKIE data sanitized
INFO - 2017-12-06 17:05:45 --> Input Class Initialized
INFO - 2017-12-06 17:05:45 --> Language Class Initialized
INFO - 2017-12-06 17:05:45 --> Loader Class Initialized
INFO - 2017-12-06 17:05:45 --> Controller Class Initialized
INFO - 2017-12-06 17:05:45 --> Database Driver Class Initialized
DEBUG - 2017-12-06 17:05:45 --> Config file loaded: C:\xampp\htdocs\Code12\application\config/db_tables.php
DEBUG - 2017-12-06 17:05:45 --> Config file loaded: C:\xampp\htdocs\Code12\application\third_party/community_auth/config/db_tables.php
DEBUG - 2017-12-06 17:05:45 --> Config file loaded: C:\xampp\htdocs\Code12\application\config/authentication.php
DEBUG - 2017-12-06 17:05:45 --> Config file loaded: C:\xampp\htdocs\Code12\application\third_party/community_auth/config/authentication.php
INFO - 2017-12-06 17:05:45 --> Session: Class initialized using 'database' driver.
DEBUG - 2017-12-06 17:05:45 --> Encryption: Auto-configured driver 'openssl'.
INFO - 2017-12-06 17:05:45 --> Encryption: OpenSSL initialized with method AES-128-CBC.
INFO - 2017-12-06 17:05:45 --> Encryption Class Initialized
INFO - 2017-12-06 17:05:45 --> Helper loaded: serialization_helper
INFO - 2017-12-06 17:05:45 --> Helper loaded: cookie_helper
INFO - 2017-12-06 17:05:45 --> Model Class Initialized
INFO - 2017-12-06 17:05:46 --> Helper loaded: url_helper
INFO - 2017-12-06 17:05:46 --> Helper loaded: form_helper
INFO - 2017-12-06 17:05:46 --> Final output sent to browser
DEBUG - 2017-12-06 17:05:46 --> Total execution time: 0.8530
INFO - 2017-12-06 17:05:46 --> Config Class Initialized
INFO - 2017-12-06 17:05:46 --> Hooks Class Initialized
DEBUG - 2017-12-06 17:05:46 --> UTF-8 Support Enabled
INFO - 2017-12-06 17:05:46 --> Utf8 Class Initialized
INFO - 2017-12-06 17:05:46 --> URI Class Initialized
INFO - 2017-12-06 17:05:46 --> Router Class Initialized
INFO - 2017-12-06 17:05:46 --> Output Class Initialized
INFO - 2017-12-06 17:05:46 --> Security Class Initialized
DEBUG - 2017-12-06 17:05:46 --> Global POST, GET and COOKIE data sanitized
INFO - 2017-12-06 17:05:46 --> Input Class Initialized
INFO - 2017-12-06 17:05:46 --> Language Class Initialized
ERROR - 2017-12-06 17:05:46 --> 404 Page Not Found: Login/index
Reply
#3

Maybe another question is, is it correct to have the 'Config Class' initialize twice?
Reply
#4

The first thing I'm thinking of when reading your posts is that I want to know what your .htaccess file looks like, and also your config/config.php. Also, it looks like you are on Windows and using XAMPP. Are you using mod_rewrite to attempt to remove the index.php from your URLs?
Reply
#5

1)   This is how I understood the _auth instructions to do:

# MAKE SURE TO LEAVE THE DENY LIST AT THE TOP OF THE FILE !!!
# BEGIN DENY LIST --
# END DENY LIST --
<IfModule authz_core_module>
   Require all denied
</IfModule>
<IfModule !authz_core_module>
   Deny from all
</IfModule>

It is located at Code12\application\.htaccess

2)  This is the config/config.php file. I removed the comments

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

$config['base_url'] = 'http://localhost/Code12/';

$config['index_page'] = 'index.php';


$config['uri_protocol'] = 'REQUEST_URI';

$config['url_suffix'] = '';

$config['language'] = 'english';
/
$config['charset'] = 'UTF-8';

$config['enable_hooks'] = TRUE;

$config['subclass_prefix'] = 'MY_';

$config['composer_autoload'] = FALSE;

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';


$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';

$config['allow_get_array'] = TRUE;


$config['log_threshold'] = 4;

$config['log_path'] = '';

$config['log_file_extension'] = '';

$config['log_file_permissions'] = 0644;


$config['log_date_format'] = 'Y-m-d H:iConfused';


$config['error_views_path'] = '';

$config['cache_path'] = '';


$config['cache_query_string'] = FALSE;

// AES-128 / Rijndael-128
$config['encryption_key'] = hex2bin('b115881a5d2b177f6c039f6353d1f901');

// $config['sess_driver'] = 'files';
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
//$config['sess_save_path'] = NULL;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;


$config['standardize_newlines'] = FALSE;


$config['global_xss_filtering'] = FALSE;


$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();

$config['compress_output'] = FALSE;

$config['time_reference'] = 'local';

$config['rewrite_short_tags'] = FALSE;

$config['proxy_ips'] = '';

3)  No changes to the mod-rewrite.

4) I forgot to mention, the *delimiter* section in the create tables  threw several errors when I inserted it into the sql console to create all the tables. I removed this section of code and the tables were all created successfully.

This is the section of code I removed from \sql\install

delimiter $$
DROP TRIGGER IF EXISTS ca_passwd_trigger ;
$$
CREATE TRIGGER ca_passwd_trigger BEFORE UPDATE ON users
FOR EACH ROW
BEGIN
    IF ((NEW.passwd <=> OLD.passwd) = 0) THEN
        SET NEW.passwd_modified_at = NOW();
    END IF;
END;$$
delimiter ;
Reply
#6

Jeff, instead of guessing and running in circles, if you'll just email me a link to download a zipped up copy of your entire application (from like Dropbox of Google Drive or something), I can figure out what's wrong by running it on my local machine. Include a database dump for me. It won't take long, but I'll have to do it on my next break, so give me a couple hours+
Reply
#7

Jeff, it looks like your problem was in the config/routes.php file.

You had this:


PHP Code:
$route['LOGIN_PAGE'] = 'examples/login_form'


And should have had this:


PHP Code:
$route[LOGIN_PAGE] = 'examples/login'

Notice that LOGIN_PAGE is a PHP constant, not a string. The constant is defined in the auth_constants hook.
Reply
#8

I guess I was going code blind lol. I was making so many changes that along the way, I seemed to be making progress when I changed the routes:

//$route['LOGIN_PAGE'] = 'examples/login_form';
//$route['LOGIN_PAGE'] = 'form_validation/login';
$route[LOGIN_PAGE] = 'examples/login';
//$route['LOGIN_PAGE'] = 'examples/login';
$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

Note that the 'default controller' is in single quotes as are the other default ones. Your instructions for the install do not show any quotes, so when things started going bad, among other things, in my foolishness I decided to put quotes around yours. Voila! I made progress further into the code. I made other changes and seemed to be getting places, and kept going back and switching the routes from the 'quoted' to the 'non-quoted' just in case, but no joy. At some point, I must have forgotten to go back to the proper one, and ended up with the quoted 'Login_Page' I'm not sure what I sent you, as a couple of the routes were commented out, but I AM now getting a login page. It does not seem like a complicated install, but I did scratch my head over a couple of things. I will make some notes of these and mail you about them.

Is there anything with the *delimiter stuff in the sql/install that I should be concerned about?

Thanks very much for your help. Very much appreciated.
Reply
#9

If you're having problems copying and pasting the SQL into something like phpMyAdmin, then you'd probably want to use phpMyAdmin's delimiter field set to a semicolon, ";". You can manually create the trigger, but know this, the trigger doesn't do anything for Community Auth. It's there so as an admin you can do things like force people with old passwords to create a new one. So you don't even need it, and if you're new to all of this, just forget about it for now.
Reply
#10

Another thing ... this LOGIN_PAGE constant his bitten a lot of people. I don't know how to be more clear in the installation instructions. If you have any ideas, let me know.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB