I’ve written a Java client for parts of Livy’s REST API at https://github.com/apache/incubator-livy/blob/master/docs/rest-api.md. The client uses Spring’s RestTemplate.getForObject()
and postForObject()
to make GET and POST requests respectively. The Livy server is secured with Kerberos.
GET /sessions
and GET /batches
requests work fine: I get the expected responses from Livy. But both POST /sessions
and POST /batches
requests fail with:
org.springframework.web.client.HttpClientErrorException: 401 Authentication required
Does anyone know why the POST requests fail when the GET requests succeed? My code does nothing explicit with authentication.
I've tried authenticating as several different users via Kerberos but I always get this problem. Does Livy need extra configuration to allow POST requests from particular users (since POST requests effectively create interactive sessions or submit jobs to Spark)?
401
challenge but should end either with200
or403
)? Any visible difference in the sequence of events for GET and POST e.g. a redirection at some point? – Dulosisnet
library... hopefully you are using something more recent! – DulosisRestTemplate
to use with Kerberos:KerberosRestTemplate
. Will post more when I get another chance in a few days... – Coffeycurl
command-line HTTP query (if the Kerberos TGT is available in the default cache) withcurl --negotiate -u : --trace-ascii - <some-GET-URL>
then-X POST --data 'blah blah' <some-POST-URL>
– Dulosis