MantisBT

View Issue Details Jump to Notes ] Wiki ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012738mantisbtauthenticationpublic2011-02-03 07:102011-02-03 09:22
Reporterdavidinc 
Assigned To 
PrioritynormalSeverityminorReproducibilityrandom
StatusnewResolutionopen 
PlatformOSOS Version
Product Version1.2.1 
Target VersionFixed in Version 
Summary0012738: Mantis: LDAP group authentication
DescriptionFor 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.
Attached Files

- Relationships

-  Notes
User avatar (0028148)
cas (reporter)
2011-02-03 07:32

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 [^]
User avatar (0028151)
davidinc (reporter)
2011-02-03 09:22

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

- Issue History
Date Modified Username Field Change
2011-02-03 07:10 davidinc New Issue
2011-02-03 07:32 cas Note Added: 0028148
2011-02-03 09:22 davidinc Note Added: 0028151


MantisBT 1.2.16dev master-1.2.x-8c2bd07 [^]
Copyright © 2000 - 2013 MantisBT Team
Time: 0.0697 seconds.
memory usage: 2,771 KB
Powered by Mantis Bugtracker