<?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 How do I  pass headers (username and password) via Apache knox to my custom service? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100196#M63215</link>
    <description>&lt;P&gt;I need to access username and password in my custom rest service which is passed via knox URL. Can anybody suggest changes needs to be done in rewrite.xml or service.xml?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2015 17:38:32 GMT</pubDate>
    <dc:creator>bmkool266</dc:creator>
    <dc:date>2015-12-21T17:38:32Z</dc:date>
    <item>
      <title>How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100196#M63215</link>
      <description>&lt;P&gt;I need to access username and password in my custom rest service which is passed via knox URL. Can anybody suggest changes needs to be done in rewrite.xml or service.xml?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 17:38:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100196#M63215</guid>
      <dc:creator>bmkool266</dc:creator>
      <dc:date>2015-12-21T17:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100197#M63216</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/190/kevinminder.html" nodeid="190"&gt;@Kevin Minder&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:45:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100197#M63216</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-12-21T21:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100198#M63217</link>
      <description>&lt;P&gt;In your rewrite.xml you can use a rewrite function to retrieve the current effective username.  You can see an example of this in WebHDFS.
{code}
    &amp;lt;rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/home/file" pattern="*://*:*/**/webhdfs/{version}/~/{path=**}?{**}"&amp;gt;
        &amp;lt;rewrite template="{$serviceUrl[WEBHDFS]}/{version}/user/{$username}/{path=**}?{**}"/&amp;gt;
    &amp;lt;/rule&amp;gt;
{code}&lt;/P&gt;&lt;P&gt;However password is a different matter.  There are several issues with this.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Depending upon the authorization provider there may be no password.&lt;/LI&gt;&lt;LI&gt;The general Knox model is to protect the password not to make it easy to access.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;So from this perspective perhaps we need to understand your use case a bit better to determine if there is a different way to accomplish your goals.  Without more information I'm guessing you actually need a trusted proxy model where your target service needs to trust that Knox has pre-authenticated the user and therefore only the username is required.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 00:02:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100198#M63217</guid>
      <dc:creator>kevin_minder</dc:creator>
      <dc:date>2015-12-22T00:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100199#M63218</link>
      <description>&lt;P&gt;I would also offer that this mechanism would limit the usecases in which your custom service can be used to authentication that is based on username/password.&lt;/P&gt;&lt;P&gt;There are a number of existing and upstream authentication/federation providers that do not involve providing a password to Knox. Your service will not work with KnoxSSO, HeaderPreAuth (SiteMinder, etc), OAuth, SAML, CAS, etc.&lt;/P&gt;&lt;P&gt;I would suggest that you bring your usecase to the dev@ list for Apache Knox and that we determine the best approach for services like the one you have in mind. &lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 01:41:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100199#M63218</guid>
      <dc:creator>lmccay</dc:creator>
      <dc:date>2015-12-22T01:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100200#M63219</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/190/kevinminder.html" nodeid="190"&gt;@Kevin Minder&lt;/A&gt; @Imccay for quick reply.&lt;/P&gt;&lt;P&gt;I just want username from Knox url , so that I can pass this username to my custom service in Ranger for authorization. I tried to make changes in rewrite.xml as suggested but couldn't succeed in getting username in header.I checked gateway-audit.log and found this statement.&lt;/P&gt;&lt;P&gt;dispatch|uri|http://{hostname}:{portno}/customService/insert?user.name=user_abc|success|Response status: 200  &lt;/P&gt;&lt;P&gt;I could see user.name appended in above dispatch url. I could retrieve this username as a query parameter from my custom rest service. I did not make any changes for this. Is this the default behaviour of Knox , that it appends username in dispatch url? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 21:03:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100200#M63219</guid>
      <dc:creator>bmkool266</dc:creator>
      <dc:date>2015-12-22T21:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100201#M63220</link>
      <description>&lt;P&gt;By default Knox has special behavior for Hadoop services that use the Hadoop Auth module.
&lt;A href="https://hadoop.apache.org/docs/stable/hadoop-auth/Configuration.html"&gt;https://hadoop.apache.org/docs/stable/hadoop-auth/...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So yes it adds the user.name query parameter by default.  I'm curios as to why {$username} isn't working for you though.  What version of Knox are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 22:54:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100201#M63220</guid>
      <dc:creator>kevin_minder</dc:creator>
      <dc:date>2015-12-22T22:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I  pass headers (username and password) via Apache knox to my custom service?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100202#M63221</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1657/bmkool266.html" nodeid="1657"&gt;@Bhagyashree Kulkarni&lt;/A&gt; has this been resolved? Please accept best answer or provide your own solution.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 02:00:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-I-pass-headers-username-and-password-via-Apache-knox/m-p/100202#M63221</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-02-03T02:00:07Z</dc:date>
    </item>
  </channel>
</rss>

