Logging In
Login Checklist
You can see the login page but receive a message stating that "An internal server error has occurred" or "The application credentials are incorrect for this system" every time you enter your login credentials.


Can you login via API directly?
The login form utilizes the API to authenticate users. Using a tool like Postman to test logging in directly via API is a very good way to get clarity where the error actually is. Moreover, the API will provide a better response regarding what the actual issue is.
Open Postman, and create a
POSTrequest tohttp://elentra-1x-me.localhost/api/v2/auth/loginwhile passing the following data in theBody{ "username": "admin", "password": "apple123", "auth_username": "[Your AUTH Username]", "auth_password": "[Your AUTH Password]", "auth_method": "local", "auth_app_id": 1 }You should see helpful response identifying what the logging in issue is. If the response you receive isn't helpful, then please proceed with the checklist below.
Database
Database schema is created?
Database user exists?
Database user password is correct?
Database user has permissions to the schema? (try with full permissions, to make sure that permissions aren’t the issue, restrict afterwards)
Can you connect to the database with the MySQL command line (or a database GUI like phpMyAdmin) and view the tables of the database?
Is the character encoding/collation correct for the database and the DEFAULT_CHARSET in
settings.inc.php? Mixing Latin1 and UTF8 can lead to problems. This may require adding debug statements or stepping through the login process, and checking variables/error messages.
Application
Verify the following in www-root/core/config/config.inc.php:
There is a row in
[auth_schema].registered_appswhere:script_idmatches [“auth_username” in the config file]?script_passwordmatches MD5([auth_password]) in the config file?
The
AUTH_APP_IDdefined in settings.inc.php is the same as[auth_schema].registered_apps.id? (Try puttingLog::info($app_auth_credentials);after that variable is defined in the API’sAuthController.php postLogin()method to be sure.)
API
Is the API set up correctly (for a development environment, there may be a symbolic link in
www-root/core/library/vendor/elentrapackages)? Make sure that the link is pointing to a valid API directory.Is the API accessible? You should be able to go to
[website url]/api/v2and see the message “Welcome to the Elentra API. Please see our documentation for assistance.”. You can also use Postman to work directly with the API; that will often show additional information that may be helpful.Is there a
.htaccessfile in yourwww-rootfolder?If using different Elentra applications (i.e. Admissions, ME, CPD), is the API the correct version for the application version you are running? CPD may require a different API version from ME.
User
Is there a row in
[auth_schema].user_datawhere:usernamematches the username in the login form?passwordmatches the SHA1(login form password + salt from row)?organisation_idexists in[auth_schema].organisations?the
app_idin[auth_schema].organisationsmatches theapp_idin in[auth_schema].registered_apps?
Is there a row in
[auth_schema].user_accesswhere:user_idmatches the id field in[auth_schema].user_data?app_idmatches the id in[auth_schema].registered_apps?organisation_idmatches the id in[auth_schema].user_data?account_activeis true?access_startsis before now?access_expiresis after now (or 0)?locked_out_untilis NULL?
Organisation
Is the “organisation_id” set to the correct value in
settings.inc.php?Do the “AUTH_APP_ID” and “AUTH_APP_IDS_STRING” variables in
settings.inc.phpmatch the ID of a row in the[auth_schema].registered_appstable?Are there entries in in
[auth_schema].user_preferencesfor the “organisation_switcher” module that are pointing to the wrongorganisation_id? These rows can safely be removed because they will be regenerated as needed (they determine which Organisation is the default for that user when logging in).In the in
[auth_schema].organisationstable, is the template for this organisation set to awww-root/templatesdirectory that does not exist (e.g. if the DB has come from a live site that has a customized set of templates, and your development site doesn't have them)?
Logs
Be sure to check the following logs if you cannot see any errors or warnings being printed to the screen.
www-root/core/storage/logs/api.logwww-root/core/storage/logs/error_logApache logs (typically
/var/log/httpd/error_log or /var/log/httpd/ssl_error_log)
If you are developing using a Docker container, ensure that you are checking the logs from inside the container, not the host operating system!
Other Debugging Tips
Enable Laravel debug messages (only for use in development) by running the following command from the root of your
elentra-1x-meproject.echo "APP_DEBUG=true" > www-root/core/library/vendor/elentrapackages/elentra-1x-api/.env
Last updated