<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Ambari LDAP API not working &amp;gt; 2.4.2 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170437#M132741</link>
    <description>&lt;P&gt;Hello &lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for replying. I am using ActiveDirectory on Windows Server 2012 R2, and I confirmed it's running by using telnet from my RedHat box. I used the corrected curl command you posted, and the result is the same.&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ curl -k -i -u &amp;lt;redacted&amp;gt; -H 'X-Requested-By: ambari' -X POST -d '[{"Event":{"specs":[{"principal_type":"users","sync_type":"all"},{"principal_type":"groups","sync_type":"all"}]}}]' &lt;A href="https://localhost:8443/api/v1/ldap_sync_events"&gt;https://localhost:8443/api/v1/ldap_sync_events&lt;/A&gt;
HTTP/1.1 500 Server Error
Strict-Transport-Security: max-age=31536000
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 48
Server: Jetty(8.1.19.v20160209)
{
  "status": 500,
  "message": "Server Error"
}&lt;/PRE&gt;&lt;P&gt;ambari.properties:&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ cat /etc/ambari-server/conf/ambari.properties | grep ldap
ambari.ldap.isConfigured=true
authentication.ldap.baseDn=dc
authentication.ldap.bindAnonymously=true
authentication.ldap.dnAttribute=cn
authentication.ldap.groupMembershipAttr=member
authentication.ldap.groupNamingAttr=name
authentication.ldap.groupObjectClass=group
authentication.ldap.primaryUrl=&amp;lt;redacted&amp;gt;:389
authentication.ldap.referral=ignore
authentication.ldap.secondaryUrl=&amp;lt;redacted&amp;gt;:389
authentication.ldap.useSSL=false
authentication.ldap.userObjectClass=user
authentication.ldap.usernameAttribute=name
client.security=ldap&lt;/PRE&gt;&lt;P&gt;ambari-server.log:&lt;/P&gt;&lt;PRE&gt;22 Mar 2017 12:34:38,591  WARN [ambari-client-thread-24] ServletHandler:561 - Error Processing URI: /api/v1/ldap_sync_events - (org.springframework.ldap.BadLdapGrammarException) Failed to parse DN; nested exception is org.springframework.ldap.core.ParseException: Encountered "&amp;lt;EOF&amp;gt;" at line 1, column 2.
Was expecting:
    &amp;lt;SPACED_EQUALS&amp;gt; ...&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Mar 2017 23:43:25 GMT</pubDate>
    <dc:creator>smasoud</dc:creator>
    <dc:date>2017-03-22T23:43:25Z</dc:date>
    <item>
      <title>Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170435#M132739</link>
      <description>&lt;P&gt;My Ambari server (RedHat 7.3) is listening on ::1 (IPv6), and when I run 'ambari-server sync-ldap', it tries to make a request to 127.0.0.1, which results in a 'Connection refused':&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ sudo ambari-server sync-ldap --all -v 

Using python  /usr/bin/python
Syncing with LDAP... 

INFO: about to run command: ps -p 11579
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties .......Syncing all.
Calling API &lt;A href="https://127.0.0.1:8443/api/v1/ldap_sync_events" target="_blank"&gt;https://127.0.0.1:8443/api/v1/ldap_sync_events&lt;/A&gt; : [{'Event': {'specs': [{'principal_type': 'users', 'sync_type': 'all'}, {'principal_type': 'groups', 'sync_type': 'all'}]}}]
ERROR: Exiting with exit code 1.
REASON: Sync event creation failed. Error details: &amp;lt;urlopen error [Errno 111] Connection refused&amp;gt;&lt;/PRE&gt;&lt;P&gt;When I attempt to manually curl the service (https://cwiki.apache.org/confluence/display/AMBARI/API+to+sync+LDAP+users) via localhost instead of 127.0.0.1, I get a 500 error:&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ curl -i -u&amp;lt;redacted&amp;gt; -H 'X-Requested-By: ambari' -X POST -d '"[{"Event":{"specs":[{"principal_type":"users","sync_type":"all"},{"principal_type":"groups","sync_type":"all"}]}}]' &lt;A href="https://localhost:8443/api/v1/ldap-sync-events" target="_blank"&gt;https://localhost:8443/api/v1/ldap-sync-events&lt;/A&gt; -k HTTP/1.1 500 Server Error
Strict-Transport-Security: max-age=31536000
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 48
Server: Jetty(8.1.19.v20160209)
{
  "status": 500,
  "message": "Server Error"&lt;/PRE&gt;&lt;P&gt;Tailing the log:&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$tail -30 /var/log/ambari-server/ambari-server.log

22 Mar 2017 10:30:55,779  WARN [ambari-client-thread-24] ServletHandler:561 - Error Processing URI: /api/v1/ldap-sync-events - (org.springframework.ldap.BadLdapGrammarException) Failed to parse DN; nested exception is org.springframework.ldap.core.ParseException: Encountered "&amp;lt;EOF&amp;gt;" at line 1, column 2.
Was expecting:
    &amp;lt;SPACED_EQUALS&amp;gt; ...&lt;/PRE&gt;&lt;P&gt;Is there any way to either have the 'sync-ldap' command send the request to localhost instead of 127.0.0.1, or is there something wrong with my manual curl request?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 21:48:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170435#M132739</guid>
      <dc:creator>smasoud</dc:creator>
      <dc:date>2017-03-22T21:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170436#M132740</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16501/smasoud.html" nodeid="16501"&gt;@Said Masoud&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please check if the LDAP service is running or not?  Because you are getting  &lt;STRONG&gt;"&amp;lt;urlopen error [Errno 111] Connection refused&amp;gt;"  &lt;/STRONG&gt; If the LDAP is not running then you can start it. For OpenLDap something like following:&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# service slapd start&lt;/PRE&gt;&lt;P&gt;- Please check if the &lt;EM&gt;&lt;STRONG&gt;"authentication.ldap.primaryUrl" &lt;/STRONG&gt;&lt;/EM&gt;host&amp;amp; port mentioned in the following properly of the &lt;EM&gt;ambari.properties &lt;/EM&gt;are accessible from ambari host or not?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# cat /etc/ambari-server/conf/ambari.properties | grep 'authentication.ldap.primaryUrl'
authentication.ldap.primaryUrl=erie1.example.com:389

# telnet  erie1.example.com  389&lt;/PRE&gt;&lt;P&gt;- Also in your curl command you have an extra Quotation mark here [&lt;STRONG&gt;-d '"[{"Event"&lt;/STRONG&gt;]  where as it should be [&lt;STRONG&gt;-d '[{"Event"&lt;/STRONG&gt;] example as following:&lt;/P&gt;&lt;PRE&gt;curl -k -i -u admin:admin -H 'X-Requested-By: ambari' -X POST -d '[{"Event":{"specs":[{"principal_type":"users","sync_type":"all"},{"principal_type":"groups","sync_type":"all"}]}}]' &lt;A href="https://127.0.0.1:8443/api/v1/ldap_sync_events" target="_blank"&gt;https://127.0.0.1:8443/api/v1/ldap_sync_events&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;
- 
In your ambari-server.log there is some error related to DN as following so can you please share the output of the following command (if possible can you please share ambari-server.log and ambari.properties)&lt;/P&gt;&lt;PRE&gt;# cat /etc/ambari-server/conf/ambari.properties | grep ldap

Example output:
----------------
#  cat /etc/ambari-server/conf/ambari.properties | grep ldap
ambari.ldap.isConfigured=true
authentication.ldap.baseDn=dc=example,dc=com
authentication.ldap.bindAnonymously=false
authentication.ldap.dnAttribute=dn
authentication.ldap.groupMembershipAttr=memberUid
authentication.ldap.groupNamingAttr=cn
authentication.ldap.groupObjectClass=posixGroup
authentication.ldap.managerDn=cn=Manager,dc=example,dc=com
authentication.ldap.managerPassword=/etc/ambari-server/conf/ldap-password.dat
authentication.ldap.primaryUrl=erie1.example.com:389
authentication.ldap.referral=ignore
authentication.ldap.useSSL=false
authentication.ldap.userObjectClass=posixAccount
authentication.ldap.usernameAttribute=uid
client.security=ldap
&lt;/PRE&gt;&lt;P&gt;
&lt;STRONG&gt;Error&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Failed to parse DN; nested exception is org.springframework.ldap.core.ParseException: Encountered "&amp;lt;EOF&amp;gt;" at line 1, column 2.&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:05:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170436#M132740</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-22T23:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170437#M132741</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for replying. I am using ActiveDirectory on Windows Server 2012 R2, and I confirmed it's running by using telnet from my RedHat box. I used the corrected curl command you posted, and the result is the same.&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ curl -k -i -u &amp;lt;redacted&amp;gt; -H 'X-Requested-By: ambari' -X POST -d '[{"Event":{"specs":[{"principal_type":"users","sync_type":"all"},{"principal_type":"groups","sync_type":"all"}]}}]' &lt;A href="https://localhost:8443/api/v1/ldap_sync_events"&gt;https://localhost:8443/api/v1/ldap_sync_events&lt;/A&gt;
HTTP/1.1 500 Server Error
Strict-Transport-Security: max-age=31536000
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 48
Server: Jetty(8.1.19.v20160209)
{
  "status": 500,
  "message": "Server Error"
}&lt;/PRE&gt;&lt;P&gt;ambari.properties:&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ cat /etc/ambari-server/conf/ambari.properties | grep ldap
ambari.ldap.isConfigured=true
authentication.ldap.baseDn=dc
authentication.ldap.bindAnonymously=true
authentication.ldap.dnAttribute=cn
authentication.ldap.groupMembershipAttr=member
authentication.ldap.groupNamingAttr=name
authentication.ldap.groupObjectClass=group
authentication.ldap.primaryUrl=&amp;lt;redacted&amp;gt;:389
authentication.ldap.referral=ignore
authentication.ldap.secondaryUrl=&amp;lt;redacted&amp;gt;:389
authentication.ldap.useSSL=false
authentication.ldap.userObjectClass=user
authentication.ldap.usernameAttribute=name
client.security=ldap&lt;/PRE&gt;&lt;P&gt;ambari-server.log:&lt;/P&gt;&lt;PRE&gt;22 Mar 2017 12:34:38,591  WARN [ambari-client-thread-24] ServletHandler:561 - Error Processing URI: /api/v1/ldap_sync_events - (org.springframework.ldap.BadLdapGrammarException) Failed to parse DN; nested exception is org.springframework.ldap.core.ParseException: Encountered "&amp;lt;EOF&amp;gt;" at line 1, column 2.
Was expecting:
    &amp;lt;SPACED_EQUALS&amp;gt; ...&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:43:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170437#M132741</guid>
      <dc:creator>smasoud</dc:creator>
      <dc:date>2017-03-22T23:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170438#M132742</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16501/smasoud.html" nodeid="16501"&gt;@Said Masoud
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Your BaseDn is too open. Are you sure that is what you want. &lt;/P&gt;&lt;PRE&gt;authentication.ldap.baseDn=dc      
   ----&amp;gt;   can it be authentication.ldap.baseDn=dc=example,dc=com
&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;The error "org.springframework.ldap.BadLdapGrammarException" indicates that incorrect value is specified as LDAP attributes. See: &lt;A href="http://docs.spring.io/spring-ldap/docs/current/apidocs/org/springframework/ldap/BadLdapGrammarException.html" target="_blank"&gt;http://docs.spring.io/spring-ldap/docs/current/apidocs/org/springframework/ldap/BadLdapGrammarException.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;
&lt;A rel="user" href="https://community.cloudera.com/users/16501/smasoud.html" nodeid="16501"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 00:18:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170438#M132742</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-23T00:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170439#M132743</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I changed the baseDn peoperty to match the example you gave me, still getting the same error. &lt;/P&gt;&lt;P&gt;Has Ambari been confirmed to work with Windows Server 2012? I am concerned that it cannot interface with a newer version of Windows.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 00:40:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170439#M132743</guid>
      <dc:creator>smasoud</dc:creator>
      <dc:date>2017-03-23T00:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170440#M132744</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16501/smasoud.html" nodeid="16501"&gt;@Said Masoud&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ambari does work with Windows Server 2012 and we have done that multiple times in past.&lt;/P&gt;&lt;P&gt;If you are using Windows Server 2012 with Ambari for user sync, then you are not using the correct AD user attribute name and also trying to bind anonymously. Please use a correct bind DN and password to successfully bind to AD server.&lt;/P&gt;&lt;P&gt;Your properties should look like these (Similar to what &lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt; has given but with correct AD user attribute name):&lt;/P&gt;&lt;PRE&gt;authentication.ldap.baseDn=ou=Users,ou=corporate,dc=example,dc=com (this should NOT be a top level DC of your AD)
authentication.ldap.bindAnonymously=false
authentication.ldap.dnAttribute=distinguishedName
authentication.ldap.groupMembershipAttr=member
authentication.ldap.groupNamingAttr=name
authentication.ldap.groupObjectClass=group
authentication.ldap.primaryUrl=&amp;lt;redacted&amp;gt;:389
authentication.ldap.referral=ignore
authentication.ldap.secondaryUrl=&amp;lt;redacted&amp;gt;:389
authentication.ldap.useSSL=false
authentication.ldap.userObjectClass=user
authentication.ldap.usernameAttribute=sAMAccountName
authentication.ldap.managerDn=cn=bind-user,ou=Users,ou=corporate,dc=example,dc=com
authentication.ldap.managerPassword=...
&lt;/PRE&gt;&lt;P&gt;A better way to set this up is via 'setup-ldap' command (which also takes care of hiding the bind DN's password) like this:&lt;/P&gt;&lt;PRE&gt;# ambari-server setup-ldap \
  --ldap-url=&amp;lt;ad-host-fqdn&amp;gt;:389 \
  --ldap-secondary-url= \
  --ldap-ssl=false \
  --ldap-base-dn=ou=Users,ou=corporate,dc=example,dc=com \
  --ldap-manager-dn=cn=bind-user,ou=Users,ou=corporate,dc=example,dc=com \
  --ldap-bind-anonym=false \
  --ldap-dn=distinguishedName \
  --ldap-member-attr=member \
  --ldap-group-attr=cn \
  --ldap-group-class=group \
  --ldap-user-class=user \
  --ldap-user-attr=sAMAccountName \
  --ldap-save-settings \
  --ldap-bind-anonym=false \
  --ldap-referral=ignore&lt;/PRE&gt;&lt;P&gt;Hope this helps !&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 00:57:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170440#M132744</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2017-03-24T00:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170441#M132745</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/740/vrathor.html" nodeid="740"&gt;@Vipin Rathor&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thank you! Binding with a manager as a user seems to have resolved the previous issue and allowed me to establish a proper connection to Windows, but now I cannot seem to form the proper curl command to sync the users. I believe the way I am feeding the username/password combination is incorrect. This is the command I'm using and the result:&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ curl -k -i -u '&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;' -H 'X-Requested-By: ambari' -X POST -d '[{"Event":{"specs":[{"principal_type":"users","sync_type":"all"},{"principal_type":"groups","sync_type":"all"}]}}]' &amp;lt;a href="https://localhost:8443/api/v1/ldap_sync_events"&amp;gt;https://localhost:8443/api/v1/ldap_sync_events&amp;lt;/a&amp;gt;
HTTP/1.1 403 Unable to sign in. Invalid username/password combination.
Strict-Transport-Security: max-age=31536000
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 93
Server: Jetty(8.1.19.v20160209)
{
  "status": 403,
  "message": "Unable to sign in. Invalid username/password combination."
}&lt;/PRE&gt;&lt;P&gt;ambari-server.log:&lt;/P&gt;&lt;PRE&gt;23 Mar 2017 16:08:40,244  INFO [ambari-client-thread-25] FilterBasedLdapUserSearch:89 - SearchBase not set. Searches will be performed from the root: cn=Users,dc=&amp;lt;redacted&amp;gt;,dc=local
23 Mar 2017 16:09:20,619 ERROR [ambari-client-thread-28] AmbariLdapAuthoritiesPopulator:71 - Can't get authorities for user &amp;lt;user&amp;gt;, he is not present in local DB&lt;/PRE&gt;&lt;P&gt;UPDATE: it appears that the original admin user i created in Ambari UI is no longer in the users table (PostgreSQL database). How can I manually add the user back into the database?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 03:12:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170441#M132745</guid>
      <dc:creator>smasoud</dc:creator>
      <dc:date>2017-03-24T03:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170442#M132746</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://community.cloudera.com/users/16501/smasoud.html" nodeid="16501"&gt;@Said Masoud&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I don't understand why you are trying to sync using REST API &amp;amp; curl. I'd rather use 'ambari-server sync-ldap -all -v' to sync all the users and groups. I don't know how to make this curl call work, can you please try this command &amp;amp; let us know.&lt;/P&gt;&lt;P&gt;Hope this helps !&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 06:45:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170442#M132746</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2017-03-24T06:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170443#M132747</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/740/vrathor.html" nodeid="740"&gt;@Vipin Rathor&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I cannot use the ambari-server command because that command makes a request to 127.0.0.1 (IPv4), which fails because the ambari-server is binding to ::1 (IPv6):&lt;/P&gt;&lt;PRE&gt;[ec2-user@ip-192-168-12-67 ~]$ sudo ambari-server sync-ldap --all -v
Using python  /usr/bin/python
Syncing with LDAP...
INFO: about to run command: ps -p 22683
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
Enter Ambari Admin login: &amp;lt;user&amp;gt;
Enter Ambari Admin password:
Syncing all.
Calling API &lt;A href="https://127.0.0.1:8443/api/v1/ldap_sync_events"&gt;https://127.0.0.1:8443/api/v1/ldap_sync_events&lt;/A&gt; : [{'Event': {'specs': [{'principal_type': 'users', 'sync_type': 'all'}, {'principal_type': 'groups', 'sync_type': 'all'}]}}]
ERROR: Exiting with exit code 1.
REASON: Sync event creation failed. Error details: &amp;lt;urlopen error [Errno 111] Connection refused&amp;gt;
[ec2-user@ip-192-168-12-67 ~]$ sudo curl -k -i -u '&amp;lt;redacted&amp;gt;' -H 'X-Requested-By: ambari' -X POST -d '[{"Event":{"specs":[{"principal_type":"users","sync_type":"all"},{"principal_type":"groups","sync_type":"all"}]}}]' &lt;A href="https://localhost:8443/api/v1/ldap_sync_events"&gt;https://localhost:8443/api/v1/ldap_sync_events&lt;/A&gt;
HTTP/1.1 403 Unable to sign in. Invalid username/password combination.
Strict-Transport-Security: max-age=31536000
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 93
Server: Jetty(8.1.19.v20160209)
{
  "status": 403,
  "message": "Unable to sign in. Invalid username/password combination."
}&lt;/PRE&gt;&lt;P&gt;ambari-server.log:&lt;/P&gt;&lt;PRE&gt;24 Mar 2017 10:25:40,841 ERROR [ambari-client-thread-28] AmbariLdapAuthoritiesPopulator:71 - Can't get authorities for user ambari, he is not present in local DB&lt;/PRE&gt;&lt;P&gt;I believe the current issue I am experiencing is the Ambari credentials are not in the 'users' table in PostgreSQL. Is there a way I can add those credentials to the table manually?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 21:29:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170443#M132747</guid>
      <dc:creator>smasoud</dc:creator>
      <dc:date>2017-03-24T21:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari LDAP API not working &gt; 2.4.2</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170444#M132748</link>
      <description>&lt;P&gt;UPDATE: I ended up rebuilding a new Ambari server and database from scratch, and running the 'sync-ldap' command using the default credentials (admin:admin). I think changing the default credentials before syncing the LDAP users causes the sync to fail, will try to raise an issue about this in Github. Thanks &lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay SenSharma&lt;/A&gt; and &lt;A rel="user" href="https://community.cloudera.com/users/740/vrathor.html" nodeid="740"&gt;@Vipin Rathor&lt;/A&gt; for your help! I used your suggestions when I rebuilt Ambari and they were very helpful!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:58:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-LDAP-API-not-working-gt-2-4-2/m-p/170444#M132748</guid>
      <dc:creator>smasoud</dc:creator>
      <dc:date>2017-03-28T19:58:19Z</dc:date>
    </item>
  </channel>
</rss>

