Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP userLogin fails due to missing template file in DataGridBase.php #1048

Closed
vmario89 opened this issue Sep 27, 2018 · 4 comments
Closed
Labels

Comments

@vmario89
Copy link
Contributor

vmario89 commented Sep 27, 2018

sysPass Version
300.18092401

Describe the bug

  1. I created a working connection to our LDAP Server
  2. I imported users via LDAP
  3. I went to the syspass user login page and logged in the new imported User
  4. The sytem asked me to encrypt the new user with Master Password
  5. The login fails after re-entering the credentials: "Unable to retrieve the "userLogin" variable"

grafik

As you can see the error is thrown in plain text

I was able to trace up to the file DataGridBase.php which throws the Error. But i do not understand the problem. Do you have an idea what the problem could be here?

regards, Mario

@nuxsmin
Copy link
Owner

nuxsmin commented Oct 1, 2018

Hi,

The login fails after re-entering the credentials: "Unable to retrieve the "userLogin" variable"

Does it show up a blank page and the message on it?

This message is thrown whenever a view's (layout) variable hasn't been set and some page requires it for displaying its content.

Regards

@vmario89
Copy link
Contributor Author

vmario89 commented Oct 1, 2018

Hi, yes the page is blank only with message on it.
grafik

`The log output for this is:
2018-10-01 11:45:04 [DEBUG] [SP\Core\Language::setLocales] Locale set to: en_US.utf8
2018-10-01 11:45:04 [DEBUG] [SP\Config\Config::initialize] Config loaded
2018-10-01 11:45:04 [DEBUG] [SP\Bootstrap::run] ------------
2018-10-01 11:45:04 [DEBUG] [SP\Bootstrap::run] Boostrap:web
2018-10-01 11:45:04 [DEBUG] [SP\Bootstrap::initializeCommon] initializeCommon
2018-10-01 11:45:04 [INFO] [SP\Core\PhpExtensionChecker::checkMandatory] Extensions checked
2018-10-01 11:45:04 [DEBUG] [SP\Modules\Web\Init::initialize] SP\Modules\Web\Init::initialize
2018-10-01 11:45:05 [DEBUG] [SP\Core\Language::setLocales] Locale set to: en_US.utf8
2018-10-01 11:45:05 [INFO] [SP\Core\UI\Theme::initIcons] Loaded icons cache
2018-10-01 11:45:05 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Log\DatabaseLogHandler
2018-10-01 11:45:05 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Log\FileLogHandler
2018-10-01 11:45:05 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Log\SyslogHandler
2018-10-01 11:45:05 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Notification\NotificationHandler
2018-10-01 11:45:05 [DEBUG] [SP\Bootstrap::SP{closure}] Routing call: SP\Modules\Web\Controllers\LoginController::loginAction::Array
(
)

2018-10-01 11:45:05 [INFO] [SP\Core\Acl\Actions::loadCache] Loaded actions cache
2018-10-01 11:45:05 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT id, userId
FROM Track
WHERE time >= ?
AND (ipv4 = ? OR ipv6 = ?)
AND source = ?;
2018-10-01 11:45:05 [EXCEPTION] [N/A] Error while searching objects in base DN
#0 /srv/www/vhosts/thedomain.de/lib/SP/Providers/Auth/Ldap/LdapActions.php(195): SP\Providers\Auth\Ldap\LdapActions->getObjects('(&(|(samaccount...')
#1 /srv/www/vhosts/thedomain.de/lib/SP/Providers/Auth/Ldap/LdapAuth.php(154): SP\Providers\Auth\Ldap\LdapActions->getAttributes('(&(|(samaccount...')
#2 /srv/www/vhosts/thedomain.de/lib/SP/Providers/Auth/Ldap/LdapAuth.php(119): SP\Providers\Auth\Ldap\LdapAuth->getAttributes('Mario.Voigt')
#3 /srv/www/vhosts/thedomain.de/lib/SP/Providers/Auth/AuthProvider.php(133): SP\Providers\Auth\Ldap\LdapAuth->authenticate(Object(SP\DataModel\UserLoginData))
#4 /srv/www/vhosts/thedomain.de/lib/SP/Providers/Auth/AuthProvider.php(90): SP\Providers\Auth\AuthProvider->authLdap()
#5 /srv/www/vhosts/thedomain.de/lib/SP/Services/Auth/LoginService.php(144): SP\Providers\Auth\AuthProvider->doAuth(Object(SP\DataModel\UserLoginData))
#6 /srv/www/vhosts/thedomain.de/app/modules/web/Controllers/LoginController.php(69): SP\Services\Auth\LoginService->doLogin()
#7 [internal function]: SP\Modules\Web\Controllers\LoginController->loginAction()
#8 /srv/www/vhosts/thedomain.de/lib/SP/Bootstrap.php(222): call_user_func_array(Array, Array)
#9 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#10 /srv/www/vhosts/thedomain.de/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure), Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#11 /srv/www/vhosts/thedomain.de/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route), Object(Klein\DataCollection\RouteCollection), Array)
#12 /srv/www/vhosts/thedomain.de/lib/SP/Bootstrap.php(432): Klein\Klein->dispatch(Object(Klein\Request))
#13 /srv/www/vhosts/thedomain.de/lib/Base.php(72): SP\Bootstrap::run(Object(DI\Container))
#14 /srv/www/vhosts/thedomain.de/index.php(28): require('/srv/www/vhosts...')
#15 {main}
2018-10-01 11:45:05 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT U.id,
U.name,
U.userGroupId,
UG.name AS userGroupName,
U.login,
U.ssoLogin,
U.email,
U.notes,
U.loginCount,
U.userProfileId,
U.lastLogin,
U.lastUpdate,
U.lastUpdateMPass,
U.preferences,
U.pass,
U.hashSalt,
U.mPass,
U.mKey,
U.isAdminApp,
U.isAdminAcc,
U.isLdap,
U.isDisabled,
U.isChangePass,
U.isChangedPass,
U.isMigrate
FROM User U
INNER JOIN UserGroup UG ON U.userGroupId = UG.id
WHERE U.login = ? OR U.ssoLogin = ? LIMIT 1;
2018-10-01 11:45:05 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT id FROM User WHERE UPPER(login) = UPPER(?) OR UPPER(ssoLogin) = UPPER(?) LIMIT 1;
2018-10-01 11:45:05 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;UPDATE User SET
pass = ?,
hashSalt = '',
name = ?,
email = ?,
lastUpdate = NOW(),
lastLogin = NOW(),
isLdap = ?
WHERE UPPER(login) = UPPER(?) OR UPPER(ssoLogin) = UPPER(?) LIMIT 1;
2018-10-01 11:45:05 [DEBUG] [SP\Http\Request::analyzeEncrypted] No RSA encrypted data from request
2018-10-01 11:45:05 [DEBUG] [SP\Http\Request::analyzeEncrypted] No RSA encrypted data from request
2018-10-01 11:45:05 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT parameter, value FROM Config WHERE parameter = ? LIMIT 1;
2018-10-01 11:45:05 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT parameter, value FROM Config WHERE parameter = ? LIMIT 1;
2018-10-01 11:45:06 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;UPDATE User SET lastLogin = NOW(), loginCount = loginCount + 1 WHERE id = ? LIMIT 1;
2018-10-01 11:45:06 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;UPDATE User SET lastLogin = NOW(), loginCount = loginCount + 1 WHERE id = ? LIMIT 1;
2018-10-01 11:45:06 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT id, name, profile FROM UserProfile WHERE id = ? LIMIT 1;
2018-10-01 11:45:06 [DEBUG] [SP\Core\Language::setLocales] Locale set to: en_US.utf8
2018-10-01 11:45:06 [DEBUG] [SP\Core\Language::setLocales] Locale set to: en_US.utf8
2018-10-01 11:45:06 [DEBUG] [SP\Config\Config::initialize] Config loaded
2018-10-01 11:45:06 [DEBUG] [SP\Bootstrap::run] ------------
2018-10-01 11:45:06 [DEBUG] [SP\Bootstrap::run] Boostrap:web
2018-10-01 11:45:06 [DEBUG] [SP\Bootstrap::initializeCommon] initializeCommon
2018-10-01 11:45:06 [INFO] [SP\Core\PhpExtensionChecker::checkMandatory] Extensions checked
2018-10-01 11:45:06 [DEBUG] [SP\Modules\Web\Init::initialize] SP\Modules\Web\Init::initialize
2018-10-01 11:45:06 [DEBUG] [SP\Core\Language::setLocales] Locale set to: en_US.utf8
2018-10-01 11:45:06 [INFO] [SP\Core\UI\Theme::initIcons] Loaded icons cache
2018-10-01 11:45:06 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Log\DatabaseLogHandler
2018-10-01 11:45:06 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Log\FileLogHandler
2018-10-01 11:45:06 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Log\SyslogHandler
2018-10-01 11:45:06 [DEBUG] [SP\Core\Events\EventDispatcherBase::attach] Attach: SP\Providers\Notification\NotificationHandler
2018-10-01 11:45:06 [DEBUG] [SP\Providers\Log\FileLogHandler::updateEvent] database.query;SELECT id, type, userId, userGroupId, userProfileId, fixed, priority, data
FROM ItemPreset
WHERE type = ? AND (userId = ? OR userGroupId = ? OR userProfileId = ?)
ORDER BY priority DESC, userId DESC, userProfileId DESC, userGroupId DESC
LIMIT 1;
2018-10-01 11:45:06 [DEBUG] [SP\Modules\Web\Init::getSessionLifeTime] Session timeout: 2400
2018-10-01 11:45:06 [DEBUG] [SP\Bootstrap::SP{closure}] Routing call: SP\Modules\Web\Controllers\IndexController::indexAction::Array
(
)

2018-10-01 11:45:06 [INFO] [SP\Core\Acl\Actions::loadCache] Loaded actions cache
2018-10-01 11:45:06 [DEBUG] [SP\Mvc\View\Template::__get] Unable to retrieve the "userLogin" variable
2018-10-01 11:45:06 [EXCEPTION] [N/A] Unable to retrieve the "userLogin" variable
#0 /srv/www/vhosts/thedomain.de/app/modules/web/Controllers/Helpers/LayoutHelper.php(245): SP\Mvc\View\Template->__get('userLogin')
#1 /srv/www/vhosts/thedomain.de/app/modules/web/Controllers/Helpers/LayoutHelper.php(75): SP\Modules\Web\Controllers\Helpers\LayoutHelper->getSessionBar()
#2 /srv/www/vhosts/thedomain.de/app/modules/web/Controllers/IndexController.php(48): SP\Modules\Web\Controllers\Helpers\LayoutHelper->getFullLayout('main', Object(SP\Core\Acl\Acl))
#3 [internal function]: SP\Modules\Web\Controllers\IndexController->indexAction()
#4 /srv/www/vhosts/thedomain.de/lib/SP/Bootstrap.php(222): call_user_func_array(Array, Array)
#5 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#6 /srv/www/vhosts/thedomain.de/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure), Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#7 /srv/www/vhosts/thedomain.de/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route), Object(Klein\DataCollection\RouteCollection), Array)
#8 /srv/www/vhosts/thedomain.de/lib/SP/Bootstrap.php(432): Klein\Klein->dispatch(Object(Klein\Request))
#9 /srv/www/vhosts/thedomain.de/lib/Base.php(72): SP\Bootstrap::run(Object(DI\Container))
#10 /srv/www/vhosts/thedomain.de/index.php(28): require('/srv/www/vhosts...')
#11 {main}

`

@nuxsmin
Copy link
Owner

nuxsmin commented Oct 1, 2018

Hi, it seems that your full user's name wasn't retrieved from LDAP so it sets the user login instead for displaying on the page.

It can be fixed by using the login stored in session variables instead of in view variables.

I'll fix it shortly. Thanks for the feedback!

Regards

nuxsmin added a commit that referenced this issue Oct 1, 2018
…sn't available. Closes #1048. Thanks to @vmario89 for the feedback.

Signed-off-by: nuxsmin <nuxsmin@syspass.org>
@nuxsmin
Copy link
Owner

nuxsmin commented Oct 2, 2018

Solved in latest commit

@nuxsmin nuxsmin closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants