View Issue Details

IDProjectCategoryView StatusLast Update
0012738mantisbtauthenticationpublic2014-01-03 05:56
Reporterdavidinc Assigned Todregad  
PrioritynormalSeverityminorReproducibilityrandom
Status closedResolutionduplicate 
Product Version1.2.1 
Summary0012738: Mantis: LDAP group authentication
Description

For the purpose of integration ICT systems authentication through LDAP, we need to enable Mantis authentication through LDAP. This authentication should be group based.

TagsNo tags attached.

Relationships

duplicate of 0009124 new LDAP group authentication 

Activities

cas

cas

2011-02-03 07:32

reporter   ~0028148

Depends on the platform where you have mantis running but we have integrated logon based upon AD (where mantis is on a windows server).
The plugin can be found here:
http://www.mantisbt.org/bugs/view.php?id=12627

davidinc

davidinc

2011-02-03 09:22

reporter   ~0028151

To make this possible I change the following core/ldap_api.php lines (273 - 299) and define this in config_inc.php page $g_ldap_group_dn = 'groupMember';.
I can't push this to mantis forge because of this message
{{{
error: Cannot access URL http://git.mantisforge.org/r/mantisbt/gtz-et.git/, return code 22
fatal: git-http-push failed
}}}
function ldap_authenticate( $p_user_id, $p_password ) {

if password is empty and ldap allows anonymous login, then

# the user will be able to login, hence, we need to check
# for this special case.
$t_ldap_organization = config_get( 'ldap_organization' );
$t_ldap_root_dn = config_get( 'ldap_root_dn' );
$t_ldap_group_dn = config_get('ldap_group_dn');

$t_username = user_get_field( $p_user_id, 'username' );
$t_ldap_uid_field = config_get( 'ldap_uid_field', 'uid' );
$t_username = user_get_field( $p_user_id, 'username' );
$t_search_filter = "(&(uid=$t_username)($t_ldap_group_dn))";
$t_search_attrs = array(
    $t_ldap_uid_field,
    'dn',
);
$t_ds = ldap_connect_bind();

log_event( LOG_LDAP, "Searching for $t_search_filter" );
$t_sr = ldap_search( $t_ds, $t_ldap_root_dn, $t_search_filter, $t_search_attrs );
$t_entries = ldap_count_entries( $t_ds, $t_sr );
ldap_free_result( $t_sr );
ldap_unbind( $t_ds );

if ( is_blank( $p_password ) || $t_entries == 0 ) {
    return false;
}

return ldap_authenticate_by_username( $t_username, $p_password );

}

Please if you have any advise to use LDAP group authentication without modifying the core page comment me here.

Thanks