<?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: docker sping kerberos LoginException: Unable to obtain password from user in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232079#M67590</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1271/sheltong.html" nodeid="1271"&gt;@Geoffrey Shelton Okot&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Why do I need krb5 if I already have keytab? I already pass the principal on java. what else is there?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2017 21:53:10 GMT</pubDate>
    <dc:creator>gjin733</dc:creator>
    <dc:date>2017-09-04T21:53:10Z</dc:date>
    <item>
      <title>docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232075#M67586</link>
      <description>&lt;P&gt;I use spring to connect to a cluster secured with kerberos. My code &lt;/P&gt;&lt;PRE&gt;private KerberosRestTemplate restTemplate = new KerberosRestTemplate("evkuzmin.keytab",&amp;lt;br&amp;gt;                                                                      "EvKuzmin@REALM");

URI uri = new URI("http" + "://" + host + ":" + port + "/webhdfs/v1" + path + "?op=OPEN");
String json = restTemplate.getForObject(uri, String.class);
return json;&lt;/PRE&gt;&lt;P&gt;Here I read read the file and return a string.&lt;/P&gt;&lt;P&gt;I generated keytab file and checked in CLI. It works.&lt;/P&gt;&lt;P&gt;I checked the app itself, it also works. In fact, when I simply run the app, I don't need kerberos keytab, because I have a ticket that is automatically used for autorization.&lt;/P&gt;&lt;P&gt;The problem start when I try to run the app in docker. If I don't use keytab, it doesn't see the ticket and I get&lt;/P&gt;&lt;PRE&gt;&amp;lt;code&amp;gt;AuthenticationException:Unauthorized&lt;/PRE&gt;&lt;P&gt;But when I use it, it can't obtain the password. What am I doing wrong?&lt;/P&gt;&lt;P&gt;Edit &lt;/P&gt;&lt;P&gt;How I start spring&lt;/P&gt;&lt;PRE&gt;docker run -d --name audpro --network=aud_pro_net -p 8080:8080 --link audpro_mongo:audpro_mongo beeline/report&lt;/PRE&gt;&lt;P&gt;How I tried to start kerberos&lt;/P&gt;&lt;PRE&gt;docker run -d --network=aud_pro_net -v /kerb:/etc/ -v /dev/urandom:/dev/random --name kerberos -e BOOTSTRAP=0 sequenceiq/kerberos
&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Sep 2017 17:00:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232075#M67586</guid>
      <dc:creator>gjin733</dc:creator>
      <dc:date>2017-09-04T17:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232076#M67587</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/16874/gjin733.html"&gt;Gjin 733&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Have a look at this quick start part of &lt;A target="_blank" href="https://hub.docker.com/r/sequenceiq/kerberos/"&gt; Docker kerberos Usage&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Tell me if that worked? &lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 17:15:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232076#M67587</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2017-09-04T17:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232077#M67588</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1271/sheltong.html" nodeid="1271"&gt;@Geoffrey Shelton Okot&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I followed the instructions, but had to change a few things. The net=host didbn't work. Changed to network=aud_pro_net. When I tried moving krb5.conf file directly like so /etc/krb5.conf:/etc/krb5.conf, I got the error that it's not a directory, so I changed it too. The rest was left as is. In the end I initialized the keytab wihtout problem. But the error persisted. &lt;STRONG&gt;Unable to obtain password. &lt;/STRONG&gt;I added everything to the post.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 19:45:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232077#M67588</guid>
      <dc:creator>gjin733</dc:creator>
      <dc:date>2017-09-04T19:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232078#M67589</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/16874/gjin733.html"&gt;Gjin 733&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You need to get a way to copy the krb5.conf  thats the center piece&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 21:21:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232078#M67589</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2017-09-04T21:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232079#M67590</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1271/sheltong.html" nodeid="1271"&gt;@Geoffrey Shelton Okot&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Why do I need krb5 if I already have keytab? I already pass the principal on java. what else is there?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 21:53:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232079#M67590</guid>
      <dc:creator>gjin733</dc:creator>
      <dc:date>2017-09-04T21:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232080#M67591</link>
      <description>&lt;P&gt;Okey. I did it. There were a few problems, but this is how the final variant looks.&lt;/P&gt;&lt;P&gt;My docker. krb5.conf and keytab are in the same folder as my docker file. When I build the project they are added to the container and in the entrypoint I use&lt;/P&gt;&lt;PRE&gt;-Djava.security.krb5.conf&lt;/PRE&gt;&lt;P&gt;to provide krb5 location. There are also a few options for debugging + I connect mongo.&lt;/P&gt;&lt;PRE&gt;FROM java:8
ADD report.jar report.jar
ADD krb5.conf /etc/krb5.conf
ADD evkuzmin.keytab /etc/evkuzmin.keytab
RUN sh -c 'touch report.jar'
ENTRYPOINT ["java","-Dspring.data.mongodb.uri=mongodb://audpro_mongo/report","-Djavax.net.debug=all","-Dsun.security.spnego.debug=true","-Dsun.security.krb5.debug=true","-Djava.security.krb5.conf=/etc/krb5.conf","-jar","/report.jar"]&lt;/PRE&gt;&lt;P&gt;Then I use &lt;CODE&gt;KerberosRestTemplate&lt;/CODE&gt; to connect to webhdfs&lt;/P&gt;&lt;PRE&gt;public String getReportJSON()throwsURISyntaxException{
    KerberosRestTemplate restTemplate =newKerberosRestTemplate("/etc/evkuzmin.keytab","EvKuzmin@DOMAIN");
    URI uri =new URI("http"+"://"+ host +":"+ port +"/webhdfs/v1"+ path +"?op=OPEN");
    String json = restTemplate.getForObject(uri,String.class);return json;
    return json;
}&lt;/PRE&gt;&lt;P&gt;If you want to run the app without docker, just build it and add the keytab to the same direction as the jar. Then change &lt;CODE&gt;/etc/evkuzmin.keytab&lt;/CODE&gt; so it points to the new location.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 20:24:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232080#M67591</guid>
      <dc:creator>gjin733</dc:creator>
      <dc:date>2017-09-05T20:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: docker sping kerberos LoginException: Unable to obtain password from user</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232081#M67592</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/16874/gjin733.html"&gt;Gjin 733&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Good to know and happy ...... everything is working fine. I am not very conversant with Docker but Kerberos and your error were pointing to the krb5.conf. &lt;/P&gt;&lt;P&gt;If you feel my response helped you resolve the issue then you can accept it to reward me. I should build some kafka docker on my cluster and test ..&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 22:17:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/docker-sping-kerberos-LoginException-Unable-to-obtain/m-p/232081#M67592</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2017-09-05T22:17:33Z</dc:date>
    </item>
  </channel>
</rss>

