how to use kerberos

1027774997 1027774997 at qq.com
Wed Jul 8 22:11:55 EDT 2020


<html>
<head>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
</head>
<body>
<style>
    font{
        line-height: 1.6;
    }
    ul,ol{
        padding-left: 20px;
        list-style-position: inside;
    }
</style>
<div style = 'font-family:Helvetica,Helvetica,微软雅黑, 宋体; line-height:1.6;'>
    <div ></div><div>
    <div><span>Hello,please help!</span></div><div>&nbsp; &nbsp;&nbsp;<span>I want to use kerberos in my application.my application use spring boot.i search the internet,i find the code integration with kafka or hadoop.my&nbsp;</span>demand is get the&nbsp;authentication with username and password from the form system user inputing.i want to ask for integration code with spring boot.i also find the KerberosRestTemplate code :</div><div><a href="https://docs.spring.io/spring-security-kerberos/docs/1.0.1.RELEASE/reference/htmlsingle/#ssk-resttemplate">https://docs.spring.io/spring-security-kerberos/docs/1.0.1.RELEASE/reference/htmlsingle/#ssk-resttemplate</a></div><div><br></div><div><pre class="programlisting" style="line-height: 1.4; color: rgb(0, 0, 0); font-size: 15px; padding: 6px 10px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; clear: both; overflow: auto; font-family: Consolas, &quot;liberation mono&quot;, Courier, monospace; font-variant-ligatures: normal; orphans: 2; widows: 2;"><span class="hl-keyword" style="color: rgb(127, 0, 85); font-weight: 700;"><span style="color: rgb(51, 51, 51); font-family: Helvetica, Arial, Freesans, Clean, sans-serif; font-size: medium; font-variant-ligatures: normal; font-weight: 400; white-space: normal;">If there is a need to access Kerberos protected web resources programmatically we have&nbsp;</span><code class="literal" style="font-size: medium; font-family: Consolas, &quot;liberation mono&quot;, Courier, monospace; color: rgb(109, 24, 11); background-color: rgb(242, 242, 242); border: 1px solid rgb(204, 204, 204); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 1px 3px 0px; text-shadow: none; white-space: nowrap; font-variant-ligatures: normal; font-weight: 400;">KerberosRestTemplate</code><span style="color: rgb(51, 51, 51); font-family: Helvetica, Arial, Freesans, Clean, sans-serif; font-size: medium; font-variant-ligatures: normal; font-weight: 400; white-space: normal;">&nbsp;which extends&nbsp;</span><code class="literal" style="font-size: medium; font-family: Consolas, &quot;liberation mono&quot;, Courier, monospace; color: rgb(109, 24, 11); background-color: rgb(242, 242, 242); border: 1px solid rgb(204, 204, 204); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; padding: 1px 3px 0px; text-shadow: none; white-space: nowrap; font-variant-ligatures: normal; font-weight: 400;">RestTemplate</code><span style="color: rgb(51, 51, 51); font-family: Helvetica, Arial, Freesans, Clean, sans-serif; font-size: medium; font-variant-ligatures: normal; font-weight: 400; white-space: normal;">&nbsp;and does necessary login actions prior to delegating to actual RestTemplate methods. You basically have few options to configure this template.</span></span></pre><pre class="programlisting" style="line-height: 1.4; color: rgb(0, 0, 0); font-size: 15px; padding: 6px 10px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; clear: both; overflow: auto; font-family: Consolas, &quot;liberation mono&quot;, Courier, monospace; font-variant-ligatures: normal; orphans: 2; widows: 2;"><span class="hl-keyword" style="color: rgb(127, 0, 85); font-weight: 700;">public</span> <span class="hl-keyword" style="color: rgb(127, 0, 85); font-weight: 700;">void</span> doWithKeytabFile() {
    KerberosRestTemplate restTemplate =
            <span class="hl-keyword" style="color: rgb(127, 0, 85); font-weight: 700;">new</span> KerberosRestTemplate(<span class="hl-string" style="color: rgb(42, 0, 255);">"/tmp/user2.keytab"</span>, <span class="hl-string" style="color: rgb(42, 0, 255);">"user2 at EXAMPLE.ORG"</span>);
    restTemplate.getForObject(<span class="hl-string" style="color: rgb(42, 0, 255);">"http://neo.example.org:8080/hello"</span>, String.<span class="hl-keyword" style="color: rgb(127, 0, 85); font-weight: 700;">class</span>);
}</pre></div>
    <div id="ntes-pcmac-signature" style="font-family:'Helvetica','Microsoft Yahei', '微软雅黑'">
    
    <div style="font-size:14px; padding: 0;  margin:0;">

    </div>
</div>
    Can I get the&nbsp;<span style="color: rgb(51, 51, 51); font-family: &quot;Microsoft YaHei&quot;, Arial, sans-serif; font-size: 13px; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">Active Directory userinfo with the code above?</span></div><!--�-->
</div>
</body>
</html>


More information about the Kerberos mailing list