Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


View this topic in a long page with up to 500 replies per page Create new topic
1 | 2 
kelirkenan
4 posts

Wannabe Geek
Inactive user


  #2365242 2-Dec-2019 23:13
Send private message

Hi, there!

 

Sorry for the late reply. I've been out of the office all last week. I'm posting my configuration LocalSettings.php. I have edited it for privacy reasons, but I think you'll get the point quickly by taking a look at it. You will note that OU, CN and other words appear there sometimes in capital letters or not. I believe that is unrelevant for your config to work as expected. What you have to make sure about is that the names your LDAP/AD entries match the ones of your config. Let's say you have a group in your LDAP called Users, then write Users in your config. Check out the groupsync and authorization parameters. I think they're related and must be both declared in order to make Authorization work properly.

 

# End of automatically generated settings.
# Add more configuration options below.

 

# LDAP
wfLoadExtensions( [
        'PluggableAuth',
        'LDAPProvider',
        'LDAPAuthentication2',
        'LDAPAuthorization',
        'Auth_remoteuser',
        'LDAPGroups'
] );

 

# I DON'T KNOW WHAT THIS DOES, BUT I THINK IT IS NEEDED ;-)
$wgAuthRemoteuserUserNameReplaceFilter = [
    '@DOMAIN.MY$' => '' // mod_krb5 and .htaccess
];

 

$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['autocreateaccount'] = true;

 

$LDAPAuthentication2UsernameNormalizer = 'strtolower';
$LDAPAuthentication2AllowLocalLogin = true;

 

$LDAPProviderDomainConfigProvider = function() {
        $config = [
                'mydomain' => [
                        'connection' => [
                                "server" => "your_server_IP_or_dns_name_without_http_https_or_whatever",
                                "user" => "CN=XXXXXX,OU=Users,OU=XXXXXX,DC=XXXXXX,",
                                "pass" => 'XXXXXXXXXXXXXXXXXXXXXX',
                                "port" => Better to use 389 to avoid SSL problems just for testing, then use 636,
                                "enctype" => 'ssl',
                                "options" => [
                                        "LDAP_OPT_DEREF" => 1
                                ],
                                "basedn" => "ou=XXXXXX,dc=XXXXXX",
                                "groupbasedn" => "ou=Groups,ou=XXXXXXXX,ou=XXXXXXXXXXX",
                                "userbasedn" => "ou=XXXXXXXXXX,dc=XXXXXXXXX",
                                "searchattribute" => "samaccountname",
                                "usernameattribute" => "samaccountname",
                                "realnameattribute" => "cn",
                                "emailattribute" => "mail",
                                "grouprequest" => "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\GroupMember::factory"
                        ],
                        'groupsync' =>
                        [
                                "mechanism" => "mappedgroups",
                                "mapping" =>
                                [
                                        "read" => "cn=XXXXXXXXXXXXXXX,ou=XXXXXXXXXXXXXXX,ou=XXXXXXXXXXXXXXX",
                                        "write" => "cn=XXXXXXXXXXXXXXX,ou=XXXXXXXXXXXXXXX,ou=XXXXXXXXXXXXXXX"
                                ]
                        ],
                        'authorization' =>
                        [
                                "rules" =>
                                [
                                        "groups" =>
                                        [
                                                "required" =>
                                                [
                                                        "cn=XXXXXXXXXXXXXXX,ou=XXXXXXXXXXXXXXX,ou=XXXXXXXXXXXXXXX"
                                                ]
                                        ]
                                ]
                        ],
                        'userinfo' => [
                                "attributes-map" => [
                                        "realname" => "cn"
                                ]
                        ]
                ]
        ];

 

        return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );
};

 

# This will show errors in your browser if there are any of them (like a --verbose option I think). Remove it in production or set it to false
$wgShowExceptionDetails = true;




awliste
2 posts

Wannabe Geek
+1 received by user: 1


  #2383565 1-Jan-2020 05:58
Send private message

Apologies for the late response. Been OOO myself, and then consumed with end of year patches/updates/disruptive maintenance. 

 

Very much appreciate this posting. Thank you. You've helped me resolve some of my syntax errors and get my group syncs working. Thank you so much!

 

 

 

R/,

 

 - A


1 | 2 
View this topic in a long page with up to 500 replies per page Create new topic









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.