Setting Up SPNEGO Authentication
SPNEGO/Kerberos authentication is configured by adding a "HadoopAuth" authentication provider to the cluster's topology file. When enabled, the Knox Gateway uses Kerberos/SPNEGO to authenticate users to Knox.
REST Invocation
Once a user logs in with kinit, their Kerberos session may be used across
client requests with things such as curl. The following curl command can be used
to request a directory listing from HDFS while authenticating with SPNEGO via
the –negotiate
flag:
curl -k -i --negotiate -u : https://localhost:8443/gateway/sandbox/webhdfs/v1/tmp?op=LISTSTATUS