Created 01-27-2017 02:32 PM
Hi,
While executing the following Ranger KMS rest API command, we have encountered the exception:
command: curl -u admin:admin -X GET http://<ranger-KMS-server>:9292/kms/v1/keys/names
Exception: Authentication required-This request requires HTTP authentication.
We have created the keyadmin principal with the password keyadmin1 as configured in kms-properties. We can create keys and list keys via Ranger KMS UI. Please advice a solution ASAP.
Created 01-31-2017 05:59 PM
@Vandana K R you need to use curl's negotiate option to authenticate via SPNEGO:
kinit -kt /etc/security/keytabs/rangerkms.service.keytab rangerkms/HOST@DOMAIN curl --negotiate -u : -H 'Content-Type: application/json' http://HOST:9292/kms/v1/key/mykey/_metadata
Created 01-27-2017 09:45 PM
Have you tried kinit'ing with the keyadmin principal and then trying the curl call with kerberos auth?
Created 01-30-2017 06:17 AM
@vperiasamy I tried kiniting the keyadmin principal. But still facing the same authentication error.
Created 01-31-2017 05:59 PM
@Vandana K R you need to use curl's negotiate option to authenticate via SPNEGO:
kinit -kt /etc/security/keytabs/rangerkms.service.keytab rangerkms/HOST@DOMAIN curl --negotiate -u : -H 'Content-Type: application/json' http://HOST:9292/kms/v1/key/mykey/_metadata
Created 02-01-2017 10:54 AM
@slachterman thank you it worked with negotiate.
Now when I disabled the kerberos and tried the same rest api command , same exception recreated.
command: curl -u keyadmin:keyadmin1 -X GET http://<ranger-KMS-server>:9292/kms/v1/keys/names
Exception: Authentication required-This request requires HTTP authentication.
Please advice
Created 02-01-2017 02:45 PM
Hi @Vandana K R, that is really a separate question, would you mind accepting my answer if it resolved your issue and creating a separate post for this issue? That will make it easier for others to find this resolution in the future.
Created 02-02-2017 05:21 AM
thank you,my issue has been resolved with negotiate option.