API - Ldap settings


#1

Hi Guys,

Trying to automate the provisioning of Graylog servers for our Devs.
We use Chef, so I’m trying to write out the Put call in Ruby.
Though, when I run this, I get 400 errors with nothing in the Graylog errorlogs.
Wondering if anyone has set this up in the past and/or can see where this is going wrong:

    RestClient::Request.execute(method: :put,
                                url: 'http://127.0.0.1:9000/api/system/ldap/settings/',
                                user: 'adminaccount', password:'password',
                                headers: {'Content-Type' => 'application/json'},
                                payload: {'enabled' => 'true',
                                          'system_username' => 'accountname',
                                          'system_password' => 'password',
                                          'ldap_url' => 'ldap://ad_server:389/',
                                          'use_start_tls' => 'false',
                                          'trust_all_certificates' => 'true',
                                          'active_directory ' => 'true',
                                          'search_base' => '(&(objectClass=user)(sAMAccountName={0}))',
                                          'display_name_attribute' => 'displayName',
                                          'default_group' => 'Reader',
                                          'group_mapping' => {},
                                          'group_search_base' => '',
                                          'group_id_attribute' => '',
                                          'additional_default_groups' => [],
                                          'group_search_pattern' => ''
                                        }.to_json
                               )

Any help would be much appreciated!

Many thanks,


(Jochen) #2

What’s in the response exactly?


(system) #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.