Support Questions

Find answers, ask questions, and share your expertise

use keytab for ambari rest api

avatar
Contributor

I am trying to sync group to ambari server using keytab through curl command.

I am using below command:

curl -i -k --negotiate -u : -H 'X-Requested-By: ambari' -X POST -d '[{"Event": {"specs":[{"principal_type":"groups","sync_type":"specific","names": "group_name"}]}}]' https://<host>:8442/api/v1/ldap_sync_events

Error:

HTTP/1.1 403 Missing authentication token Strict-Transport-Security: max-age=31536000 X-Frame-Options: DENY X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Pragma: no-cache Content-Type: text/plain;charset=ISO-8859-1 Content-Length: 64
1 ACCEPTED SOLUTION

avatar

@Sudheer Velagapudi

What version of Ambari are you using and did you turn on the Kerberos authentication feature of Ambari?

Have you looked at the Ambari server log (/var/log/ambari-server/ambari-server.log) to see if there is anything interesting (and related) in there?

Did you successfully kinit using a principal from a trusted KDC before issuing the curl command?

View solution in original post

2 REPLIES 2

avatar

@Sudheer Velagapudi

What version of Ambari are you using and did you turn on the Kerberos authentication feature of Ambari?

Have you looked at the Ambari server log (/var/log/ambari-server/ambari-server.log) to see if there is anything interesting (and related) in there?

Did you successfully kinit using a principal from a trusted KDC before issuing the curl command?

avatar
Contributor

Enabling kerberos authentication for the ambari resolved the issue.

Thank you @Robert Levas