<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Oozie REST API - Python - 401 Unauthorized in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98957#M12223</link>
    <description>&lt;P&gt;Was this answered? I tried the given suggestion, but still i'm getting following error. &lt;/P&gt;&lt;P&gt;I'm running my oozie java application through curl from edge node.&lt;/P&gt;&lt;P&gt;Steps ran:&lt;/P&gt;&lt;PRE&gt;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&lt;/PRE&gt;&lt;P&gt;...............................................&lt;/P&gt;</description>
    <pubDate>Wed, 10 Feb 2016 22:35:42 GMT</pubDate>
    <dc:creator>korvi__nareshku</dc:creator>
    <dc:date>2016-02-10T22:35:42Z</dc:date>
    <item>
      <title>Oozie REST API - Python - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98954#M12220</link>
      <description>&lt;P&gt;I am trying to use the &lt;A target="_blank" href="http://docs.python-requests.org/en/latest/"&gt;Requests&lt;/A&gt; 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 &lt;EM&gt;401 Unauthorized &lt;/EM&gt;message back.&lt;/P&gt;&lt;PRE&gt;#	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')
        )
&lt;/PRE&gt;&lt;P&gt;I have also tried including the &lt;A target="_blank" href="https://pypi.python.org/pypi/requests-kerberos"&gt;Python Kerberos &lt;/A&gt;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.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 04:20:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98954#M12220</guid>
      <dc:creator>jpasswaters</dc:creator>
      <dc:date>2015-12-13T04:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie REST API - Python - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98955#M12221</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/1354/jpasswaters.html" nodeid="1354"&gt;@Jesse Passwaters&lt;/A&gt;Good &lt;A target="_blank" href="http://blog.cloudera.com/blog/2013/06/how-to-use-the-apache-oozie-rest-api/"&gt;article&lt;/A&gt; &lt;P&gt;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 &lt;CODE&gt;--negotiate&lt;/CODE&gt; and &lt;CODE&gt;-u&lt;/CODE&gt;arguments. The username and password we specify with &lt;CODE&gt;-u&lt;/CODE&gt; 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 &lt;CODE&gt;-u&lt;/CODE&gt; then we’ll get a 401 Unauthorized error; even though its value is not actually being used. &lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 06:45:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98955#M12221</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-12-13T06:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie REST API - Python - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98956#M12222</link>
      <description>&lt;P&gt;
	Thanks 
	&lt;A rel="user" href="https://community.cloudera.com/users/140/nsabharwal.html" nodeid="140"&gt;@Neeraj Sabharwal&lt;/A&gt;.  I saw that article, but I guess it didn't click until you mentioned &lt;CODE&gt;--negotiate.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt; I then found this &lt;A href="http://python-notes.curiousefficiency.org/en/latest/python_kerberos.html"&gt;article &lt;/A&gt;that explains how to correctly use the Kerberos library when authenticating.  I have yet to try it, but have confidence it will work.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 08:09:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98956#M12222</guid>
      <dc:creator>jpasswaters</dc:creator>
      <dc:date>2015-12-13T08:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie REST API - Python - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98957#M12223</link>
      <description>&lt;P&gt;Was this answered? I tried the given suggestion, but still i'm getting following error. &lt;/P&gt;&lt;P&gt;I'm running my oozie java application through curl from edge node.&lt;/P&gt;&lt;P&gt;Steps ran:&lt;/P&gt;&lt;PRE&gt;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&lt;/PRE&gt;&lt;P&gt;...............................................&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2016 22:35:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98957#M12223</guid>
      <dc:creator>korvi__nareshku</dc:creator>
      <dc:date>2016-02-10T22:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie REST API - Python - 401 Unauthorized</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98958#M12224</link>
      <description>&lt;P&gt;Are you using the FQDN for the oozie url?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 02:36:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-REST-API-Python-401-Unauthorized/m-p/98958#M12224</guid>
      <dc:creator>jpasswaters</dc:creator>
      <dc:date>2016-02-11T02:36:22Z</dc:date>
    </item>
  </channel>
</rss>

