Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 12-12-2015 08:20 PM
I am trying to use the Requests library in Python to execute an Oozie workflow, via the REST API, in a kerberized Hadoop cluster. When trying to call the API I get a 401 Unauthorized message back.
# kerberos_auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
response = s.post(
url = 'http://localhost:11000/oozie/v1/jobs?action=start',
params = {'action': 'start'},
headers = headers,
data = workflow_xml,
# auth = kerberos_auth
auth = ('user', 'pass')
)
I have also tried including the Python Kerberos library with no success. I have looked through the Oozie log with no noticeable error messages. I am assuming it didn't even make it that far for an error to be written in the log.
Created 12-12-2015 10:45 PM
Depending on the tool we’re using to connect, additional arguments might need to be specified. For example, to use curl, as we can see above we have to specify the --negotiate and -uarguments. The username and password we specify with -u doesn’t matter because we’re using Kerberos, so we can put whatever we want (e.g. foo:bar, or even just :). If we omit the -u then we’ll get a 401 Unauthorized error; even though its value is not actually being used.
Created 12-12-2015 10:45 PM
Depending on the tool we’re using to connect, additional arguments might need to be specified. For example, to use curl, as we can see above we have to specify the --negotiate and -uarguments. The username and password we specify with -u doesn’t matter because we’re using Kerberos, so we can put whatever we want (e.g. foo:bar, or even just :). If we omit the -u then we’ll get a 401 Unauthorized error; even though its value is not actually being used.
Created 12-13-2015 12:09 AM
Thanks
@Neeraj Sabharwal. I saw that article, but I guess it didn't click until you mentioned --negotiate.
I then found this article that explains how to correctly use the Kerberos library when authenticating. I have yet to try it, but have confidence it will work.
Created 02-10-2016 02:35 PM
Was this answered? I tried the given suggestion, but still i'm getting following error.
I'm running my oozie java application through curl from edge node.
Steps ran:
1. kinit 2. curl -i -s --negotiate -u n590368c -X POST -H "Content-Type:application/xml" -d @wordcount.xml oozie_url:11000/oozie/v2/jobs?action=start Error: HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 WWW-Authenticate: Negotiate Set-Cookie: hadoop.auth=; Path=/; Domain= ; Expires=Thu, 01-Jan-1970 00:00:00 GMT; HttpOnly HTTP/1.1 201 Created Server: Apache-Coyote/1.1
...............................................
Created 02-10-2016 06:36 PM
Are you using the FQDN for the oozie url?