MantisBT - TestLink
View Issue Details
0008311TestLinkLDAP authenticationpublic2018-06-22 09:292019-09-05 09:45
johnhunt 
fman 
normalminoralways
assignedopen 
WindowsServer 201610.0.14393
1.9.17 (2018 Q1) 
 
MySQL 5.7.21 Community Server (GPL)
IE11
4.8.0
0008311: Unable to login - OAuthservers config option error in user log
Hi,

I've modified the custom_config.inc.php for LDAP authentication with the following amendments:


$tlCfg->authentication['method'] = 'LDAP';
$tlCfg->passwordChecks = null;
$tlCfg->loginPagePasswordMaxLenght = 40;
$tlCfg->logoutUrl = '';
$tlCfg->noExpDateUsers = array('admin');


$tlCfg->authentication['ldap'] = array();
$tlCfg->authentication['ldap'][1]['ldap_server'] = 'xxx.xxx.xxx.xxx';
$tlCfg->authentication['ldap'][1]['ldap_port'] = '3268';
$tlCfg->authentication['ldap'][1]['ldap_version'] = '3'; // could be '2' in some cases
$tlCfg->authentication['ldap'][1]['ldap_root_dn'] = 'OU=xxx,OU=xxx,DC=xxx,DC=xxx';
$tlCfg->authentication['ldap'][1]['ldap_bind_dn'] = 'CN=xxx,OU=xxx,OU=xxx,DC=xxx,DC=xxx'; // Left empty for anonymous LDAP binding
$tlCfg->authentication['ldap'][1]['ldap_bind_passwd'] = 'xxxxxx'; // Left empty for anonymous LDAP binding
$tlCfg->authentication['ldap'][1]['ldap_tls'] = false; // true -> use tls


$tlCfg->authentication['ldap'][1]['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)'
$tlCfg->authentication['ldap'][1]['ldap_uid_field'] = 'sAMAccountName'; // Use 'sAMAccountName' for Active Directory

$tlCfg->authentication['ldap'][1]['ldap_email_field'] = 'mail';
$tlCfg->authentication['ldap'][1]['ldap_firstname_field'] = 'givenName';
$tlCfg->authentication['ldap'][1]['ldap_surname_field'] = 'sn';

$tlCfg->user_self_signup = FALSE;


When the authentication method is changed, the configured users are unable to logon, and a HTTP 500 Internal Server Error page is presented.

The Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\logs\userlog0.log captures the following:


[>>][5b2cb7cf22bed722705867][DEFAULT][/testlink/login.php][18/Jun/22 08:48:15]
[<<][5b2cb7cf22bed722705867][DEFAULT][/testlink/login.php][18/Jun/22 08:48:15][18/Jun/22 08:48:15][took 0.011227 secs]
[>>][5b2cb7cf2d80a298497012][DEFAULT][/testlink/login.php][18/Jun/22 08:48:15]
    [18/Jun/22 08:48:15][WARNING][<nosession>][GUI]
        config option not available: OAuthServers
    [18/Jun/22 08:48:15][WARNING][<nosession>][GUI]
        E_WARNING
Invalid argument supplied for foreach() - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\login.php - Line 206
    [18/Jun/22 08:48:15][WARNING][<nosession>][GUI]
        E_NOTICE
Undefined variable: isOauth - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\lib\functions\doAuthorize.php - Line 55
    [18/Jun/22 08:48:15][WARNING][<nosession>][GUI]
        E_NOTICE
Undefined variable: isOauth - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\lib\functions\doAuthorize.php - Line 80
[<<][5b2cb7cf2d80a298497012][DEFAULT][/testlink/login.php][18/Jun/22 08:48:15][18/Jun/22 08:48:15][took 0.055404 secs]
[>>][5b2cb7d172640510941820][DEFAULT][/testlink/login.php][18/Jun/22 08:48:17]
[<<][5b2cb7d172640510941820][DEFAULT][/testlink/login.php][18/Jun/22 08:48:17][18/Jun/22 08:48:17][took 0.003676 secs]
[>>][5b2cb7d179247456865914][DEFAULT][/testlink/login.php][18/Jun/22 08:48:17]
    [18/Jun/22 08:48:17][WARNING][<nosession>][GUI]
        config option not available: OAuthServers
    [18/Jun/22 08:48:17][WARNING][<nosession>][GUI]
        E_WARNING
Invalid argument supplied for foreach() - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\login.php - Line 206
[<<][5b2cb7d179247456865914][DEFAULT][/testlink/login.php][18/Jun/22 08:48:17][18/Jun/22 08:48:17][took 0.02873 secs]

I don't know why it is referencing OAuthServers? This is not configured in the config.inc.php or custom_config.inc.php files. I can't seem to resolve this.

Thanks

Changing the $tlCfg->authentication['method'] from DB to LDAP or changing the individual test user account authentication method from Default(DB) to LDAP.
No tags attached.
Issue History
2018-06-22 09:29johnhuntNew Issue
2018-06-23 16:34fmanNote Added: 0027631
2018-06-23 16:35fmanAssigned To => fman
2018-06-23 16:35fmanStatusnew => feedback
2018-06-26 08:02johnhuntNote Added: 0027638
2018-06-26 08:02johnhuntStatusfeedback => assigned
2018-06-26 09:31fmanNote Added: 0027639
2018-06-26 14:25johnhuntNote Added: 0027641
2018-06-26 14:33fmanNote Added: 0027642
2019-09-05 08:59brahmam_klceNote Added: 0029129
2019-09-05 09:45fmanNote Added: 0029130

Notes
(0027631)
fman   
2018-06-23 16:34   
please give a try applying these changes, and provide feedback

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/fff648f70cfe75f857c6264aa475e280fb91b331 [^]
(0027638)
johnhunt   
2018-06-26 08:02   
Hi,

Thanks for the feedback. I modified each file as requested and restarted the web service but I was unable to bring up the login page.
(0027639)
fman   
2018-06-26 09:31   
is very strange, my suggestion is getting 1.9.17 bitnami installer
do fresh install, check that WITHOUT LDAP you are able to login,
check error log
provide me errors

then we will see how to continue.

I've checked against a LDAP server and have no issues, I'm using latest code from github.
(0027641)
johnhunt   
2018-06-26 14:25   
Hi,

I've reinstalled the application. I've logged on successfully without LDAP with the admin account. The userlog1.log output is:

    [18/Jun/26 14:01:28][AUDIT][kqh31l5asgdtsp6djr189hg8l4][GUI]
        Login for 'admin' from '127.0.0.1' succeeded
[<<][5b32473893948600989939][DEFAULT][/testlink/login.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.05329 secs]
[<<][5b324738a5f1a749691301][DEFAULT][/testlink/index.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.035667 secs]
[>>][5b324738b035c790092751][DEFAULT][/testlink/index.php][18/Jun/26 14:01:28]
[<<][5b324738b035c790092751][DEFAULT][/testlink/index.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.026955 secs]
[<<][5b324738bdba7917659189][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.019648 secs]
[>>][5b324738c3d1b541801612][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:28]
[<<][5b324738c3d1b541801612][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.0077970000000001 secs]
[>>][5b324738c6ca5276336697][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:28]
[<<][5b324738c6ca5276336697][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.091916 secs]
[<<][5b324738bf741133522793][DEFAULT][/testlink/lib/general/mainPage.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.125329 secs]
[>>][5b324738df2e4467769243][DEFAULT][/testlink/lib/general/mainPage.php][18/Jun/26 14:01:28]
[<<][5b324738df2e4467769243][DEFAULT][/testlink/lib/general/mainPage.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.008702 secs]
[>>][5b324738e24d0431647763][DEFAULT][/testlink/lib/general/mainPage.php][18/Jun/26 14:01:28]
[<<][5b324738e24d0431647763][DEFAULT][/testlink/lib/general/mainPage.php][18/Jun/26 14:01:28][18/Jun/26 14:01:29][took 0.091568 secs]
[<<][5b3247392129f908958790][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:29][18/Jun/26 14:01:29][took 0.06889 secs]
[>>][5b3247393328e513650802][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:29]
[<<][5b3247393328e513650802][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:29][18/Jun/26 14:01:29][took 0.008556 secs]
[>>][5b3247393665b588476658][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:29]
    [18/Jun/26 14:01:29][L18N][kqh31l5asgdtsp6djr189hg8l4][GUI]
        string 'testproject_code_tracker_integration' is not localized for locale 'en_US' - using en_GB
    [18/Jun/26 14:01:29][L18N][kqh31l5asgdtsp6djr189hg8l4][GUI]
        string 'code_tracker' is not localized for locale 'en_US' - using en_GB
    [18/Jun/26 14:01:29][L18N][kqh31l5asgdtsp6djr189hg8l4][GUI]
        string 'no_codetracker_defined' is not localized for locale 'en_US' - using en_GB
[<<][5b3247393665b588476658][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:29][18/Jun/26 14:01:29][took 0.171175 secs]
[<<][5b32474ecf1f0188808690][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:50][18/Jun/26 14:01:50][took 0.012087 secs]
[>>][5b32474ed363f114600830][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:50]
[<<][5b32474ed363f114600830][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:50][18/Jun/26 14:01:50][took 0.0081370000000001 secs]
[>>][5b32474ed6911136658736][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:50]
    [18/Jun/26 14:01:50][AUDIT][kqh31l5asgdtsp6djr189hg8l4][GUI - Test Project ID : 1]
        Test Project 'Test' was created
    [18/Jun/26 14:01:50][L18N][kqh31l5asgdtsp6djr189hg8l4][GUI - Test Project ID : 1]
        string 'th_codetracker' is not localized for locale 'en_US' - using en_GB
[<<][5b32474ed6911136658736][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:50][18/Jun/26 14:01:50][took 0.103944 secs]
[<<][5b32474f90d28311512286][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:51][18/Jun/26 14:01:51][took 0.045121 secs]
[>>][5b32474f9d294545208875][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:51]
[<<][5b32474f9d294545208875][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:51][18/Jun/26 14:01:51][took 0.0078 secs]
[>>][5b32474fa05c8078886518][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:51]
[<<][5b32474fa05c8078886518][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:51][18/Jun/26 14:01:51][took 0.01496 secs]
[<<][5b3247e34eff4736598162][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:19][18/Jun/26 14:04:19][took 0.026591 secs]
[>>][5b3247e35704c399710559][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:19]
[<<][5b3247e35704c399710559][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:19][18/Jun/26 14:04:19][took 0.008106 secs]
[>>][5b3247e35b1c0510149951][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:19]
    [18/Jun/26 14:04:19][L18N][kqh31l5asgdtsp6djr189hg8l4][GUI - Test Project ID : 1]
        string 'expiration' is not localized for locale 'en_US'
    [18/Jun/26 14:04:19][L18N][kqh31l5asgdtsp6djr189hg8l4][GUI - Test Project ID : 1]
        string 'expiration_date' is not localized for locale 'en_US' - using en_GB
[<<][5b3247e35b1c0510149951][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:19][18/Jun/26 14:04:19][took 0.197812 secs]
[<<][5b3247eb7ea0d731689813][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:27][18/Jun/26 14:04:27][took 0.014358 secs]
[>>][5b3247eb8439d352091231][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:27]
[<<][5b3247eb8439d352091231][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:27][18/Jun/26 14:04:27][took 0.007096 secs]
[>>][5b3247eb877cb028694499][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:27]
[<<][5b3247eb877cb028694499][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:27][18/Jun/26 14:04:27][took 0.009379 secs]
[<<][5b3247ee05be6741802963][DEFAULT][/testlink/logout.php][18/Jun/26 14:04:30][18/Jun/26 14:04:30][took 0.012706 secs]
[>>][5b3247ee0a428520924676][DEFAULT][/testlink/logout.php][18/Jun/26 14:04:30]
[<<][5b3247ee0a428520924676][DEFAULT][/testlink/logout.php][18/Jun/26 14:04:30][18/Jun/26 14:04:30][took 0.003026 secs]
[>>][5b3247ee0c7d5132491538][DEFAULT][/testlink/logout.php][18/Jun/26 14:04:30]
    [18/Jun/26 14:04:30][AUDIT][kqh31l5asgdtsp6djr189hg8l4][GUI - Test Project ID : 1]
        Logout of 'admin'


Interestingly, the userlog0.log contents references the OAuthServers config:


[>>][5b324734a56af254570842][DEFAULT][/testlink/index.php][18/Jun/26 14:01:24]
[<<][5b324734a56af254570842][DEFAULT][/testlink/index.php][18/Jun/26 14:01:24][18/Jun/26 14:01:24][took 0.206979 secs]
[>>][5b324734e1e19763708044][DEFAULT][/testlink/login.php][18/Jun/26 14:01:24]
[<<][5b324734e1e19763708044][DEFAULT][/testlink/login.php][18/Jun/26 14:01:24][18/Jun/26 14:01:24][took 0.054071 secs]
[>>][5b324734f0976119548177][DEFAULT][/testlink/login.php][18/Jun/26 14:01:24]
    [18/Jun/26 14:01:25][WARNING][<nosession>][GUI]
        config option not available: OAuthServers
    [18/Jun/26 14:01:25][WARNING][<nosession>][GUI]
        E_WARNING
Invalid argument supplied for foreach() - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\login.php - Line 206
[<<][5b324734f0976119548177][DEFAULT][/testlink/login.php][18/Jun/26 14:01:24][18/Jun/26 14:01:25][took 0.161448 secs]
[>>][5b32473888e3e638749163][DEFAULT][/testlink/login.php][18/Jun/26 14:01:28]
[<<][5b32473888e3e638749163][DEFAULT][/testlink/login.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.008827 secs]
[>>][5b3247388c97d152123796][DEFAULT][/testlink/login.php][18/Jun/26 14:01:28]
    [18/Jun/26 14:01:28][WARNING][<nosession>][GUI]
        config option not available: OAuthServers
    [18/Jun/26 14:01:28][WARNING][<nosession>][GUI]
        E_WARNING
Invalid argument supplied for foreach() - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\login.php - Line 206
    [18/Jun/26 14:01:28][WARNING][<nosession>][GUI]
        E_NOTICE
Trying to get property of non-object - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\lib\functions\doAuthorize.php - Line 45
[<<][5b3247388c97d152123796][DEFAULT][/testlink/login.php][18/Jun/26 14:01:28][18/Jun/26 14:01:28][took 0.023828 secs]
[>>][5b32473893948600989939][DEFAULT][/testlink/login.php][18/Jun/26 14:01:28]
[>>][5b324738a5f1a749691301][DEFAULT][/testlink/index.php][18/Jun/26 14:01:28]
[>>][5b324738bdba7917659189][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:28]
[>>][5b324738bf741133522793][DEFAULT][/testlink/lib/general/mainPage.php][18/Jun/26 14:01:28]
[>>][5b3247392129f908958790][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:29]
[>>][5b32474ecf1f0188808690][DEFAULT][/testlink/lib/project/projectEdit.php][18/Jun/26 14:01:50]
[>>][5b32474f90d28311512286][DEFAULT][/testlink/lib/general/navBar.php][18/Jun/26 14:01:51]
[>>][5b3247e34eff4736598162][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:19]
[>>][5b3247eb7ea0d731689813][DEFAULT][/testlink/lib/usermanagement/usersView.php][18/Jun/26 14:04:27]
[>>][5b3247ee05be6741802963][DEFAULT][/testlink/logout.php][18/Jun/26 14:04:30]
[<<][5b3247ee0c7d5132491538][DEFAULT][/testlink/logout.php][18/Jun/26 14:04:30][18/Jun/26 14:04:30][took 0.009766 secs]
[>>][5b3247ee140b4697735842][DEFAULT][/testlink/login.php][18/Jun/26 14:04:30]
[<<][5b3247ee140b4697735842][DEFAULT][/testlink/login.php][18/Jun/26 14:04:30][18/Jun/26 14:04:30][took 0.019813 secs]
[>>][5b3247ee1a23b183817681][DEFAULT][/testlink/login.php][18/Jun/26 14:04:30]
    [18/Jun/26 14:04:30][WARNING][<nosession>][GUI]
        config option not available: OAuthServers
    [18/Jun/26 14:04:30][WARNING][<nosession>][GUI]
        E_WARNING
Invalid argument supplied for foreach() - in C:\Bitnami\testlink-1.9.17-0\apps\testlink\htdocs\login.php - Line 206
[<<][5b3247ee1a23b183817681][DEFAULT][/testlink/login.php][18/Jun/26 14:04:30][18/Jun/26 14:04:30][took 0.022754 secs]


Thanks,
John
(0027642)
fman   
2018-06-26 14:33   
Thanks, I'm going to check during following days

regards
(0029129)
brahmam_klce   
2019-09-05 08:59   
same issue even after enabling LDAP its trying to connect local machine
(0029130)
fman   
2019-09-05 09:45   
@brahmam_klce
would you mind to provide more details?
please provide the configuration file