title: Configure the web app for Kerberos authentication using Tomcat
body: <p>I am using <a href="http://shodhganga.inflibnet.ac.in:8080/docs/windows-auth-howto.html#Tomcat_instance_(Windows_server)" rel="nofollow">windows authentication with tomcat 7</a></p>
  
  <p>I have done with domain controller setup and tomcat instance setup 
  I am unable to configure my web app with tomcat
  I mean I don't know what I have to change in web.xml, context.xml and server.xml</p>
  
  <p><strong>Copy the tomcat.keytab file created on the domain controller to $CATALINA_BASE/conf/tomcat.keytab.
  Create the kerberos configuration file $CATALINA_BASE/conf/krb5.ini. The file used in this how-to contained:</strong>  </p>
  
  <pre><code>    [libdefaults]
      default_realm = DEV.LOCAL
      default_keytab_name = FILE:c:\apache-tomcat-7.0.x\conf\tomcat.keytab
      default_tkt_enctypes = rc4-hmac,aes256-cts-hmac-sha1-96,aes128-cts-hmac-sha1-96
      default_tgs_enctypes = rc4-hmac,aes256-cts-hmac-sha1-96,aes128-cts-hmac-sha1-96
      forwardable=true
  
      [realms]
      DEV.LOCAL = {
              kdc = win-dc01.dev.local:88
      }
  </code></pre>
  
  <hr>
  
  <p><strong>The location of this file can be changed by setting the java.security.krb5.conf system property.
  Create the JAAS login configuration file $CATALINA_BASE/conf/jaas.conf. The file used in this how-to contained:</strong></p>
  
  <pre><code>    [domain_realm]
      dev.local= DEV.LOCAL
      .dev.local= DEV.LOCAL
  
  
      com.sun.security.jgss.krb5.initiate {
      com.sun.security.auth.module.Krb5LoginModule required
      doNotPrompt=true
      principal="HTTP/win-tc01.dev.local@DEV.LOCAL"
      useKeyTab=true
      keyTab="c:/apache-tomcat-7.0.x/conf/tomcat.keytab"
      storeKey=true;
  };
  
  com.sun.security.jgss.krb5.accept {
      com.sun.security.auth.module.Krb5LoginModule required
      doNotPrompt=true
      principal="HTTP/win-tc01.dev.local@DEV.LOCAL"
      useKeyTab=true
      keyTab="c:/apache-tomcat-7.0.x/conf/tomcat.keytab"
      storeKey=true;
  };
  </code></pre>