157 lines
7.5 KiB
HTML
157 lines
7.5 KiB
HTML
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
|
|
lang="en" dir="ltr">
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title></title>
|
|
<!-- metadata -->
|
|
<meta name="generator" content="Offline" />
|
|
<meta name="version" content="Offline 0.1" />
|
|
<!-- style sheet links -->
|
|
<link rel="stylesheet" media="all" type="text/css" href="../../../../css/all.css" />
|
|
<link rel="stylesheet" media="screen" type="text/css" href="../../../../css/screen.css" />
|
|
<link rel="stylesheet" media="print" type="text/css" href="../../../../css/print.css" />
|
|
|
|
</head>
|
|
<body>
|
|
<div class="dokuwiki export">
|
|
|
|
|
|
<h1 class="sectionedit1" id="apache_tomcat">Apache Tomcat</h1>
|
|
<div class="level1">
|
|
|
|
<p>
|
|
<a href="/_detail/applications/tomcat_logo.png?id=documentation%3A2.0%3Aapplications%3Atomcat" class="media" title="applications:tomcat_logo.png"><img src="../../../../media/icons/kmultiple.png" class="mediacenter" alt="" /></a>
|
|
</p>
|
|
|
|
<p>
|
|
<p><div class="noteimportant">The Tomcat Valve is only available for tomcat 5.5 or greater.
|
|
</div></p>
|
|
</p>
|
|
|
|
</div>
|
|
<!-- EDIT1 SECTION "Apache Tomcat" [1-154] -->
|
|
<h2 class="sectionedit2" id="presentation">Presentation</h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
<a href="http://tomcat.apache.org/" class="urlextern" title="http://tomcat.apache.org/" rel="nofollow">Apache Tomcat</a> is an open source software implementation of the Java Servlet and JavaServer Pages technologies.
|
|
</p>
|
|
|
|
<p>
|
|
As J2EE servlet container, Tomcat provides standard security feature, like authentication: the application deployed in Tomcat can delegate its authentication to Tomcat.
|
|
</p>
|
|
|
|
<p>
|
|
By default, Tomcat provides a file called <code>users.xml</code> to manage authentication:
|
|
</p>
|
|
<pre class="code file xml"><span class="sc3"><span class="re1"><?xml</span> <span class="re0">version</span>=<span class="st0">'1.0'</span> <span class="re0">encoding</span>=<span class="st0">'utf-8'</span><span class="re2">?></span></span>
|
|
<span class="sc3"><span class="re1"><tomcat-users<span class="re2">></span></span></span>
|
|
<span class="sc3"><span class="re1"><role</span> <span class="re0">rolename</span>=<span class="st0">"tomcat"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><role</span> <span class="re0">rolename</span>=<span class="st0">"role1"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><user</span> <span class="re0">username</span>=<span class="st0">"tomcat"</span> <span class="re0">password</span>=<span class="st0">"tomcat"</span> <span class="re0">roles</span>=<span class="st0">"tomcat"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><user</span> <span class="re0">username</span>=<span class="st0">"role1"</span> <span class="re0">password</span>=<span class="st0">"tomcat"</span> <span class="re0">roles</span>=<span class="st0">"role1"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><user</span> <span class="re0">username</span>=<span class="st0">"both"</span> <span class="re0">password</span>=<span class="st0">"tomcat"</span> <span class="re0">roles</span>=<span class="st0">"tomcat,role1"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"></tomcat-users<span class="re2">></span></span></span>
|
|
</pre>
|
|
|
|
<p>
|
|
<abbr title="LemonLDAP::NG">LL::NG</abbr> provides a valve, available on <a href="../../../download.html#contributions" class="wikilink1" title="download">download page</a>. This valve will check an HTTP header to set the authenticated user on the J2EE container.
|
|
</p>
|
|
|
|
</div>
|
|
<!-- EDIT2 SECTION "Presentation" [155-1077] -->
|
|
<h2 class="sectionedit3" id="installation">Installation</h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
Copy <code>ValveLemonLDAPNG.jar</code> in <code><TOMCAT_HOME>/server/lib</code>:
|
|
</p>
|
|
<pre class="code">cp ValveLemonLDAPNG.jar server/lib/</pre>
|
|
|
|
<p>
|
|
<p><div class="notetip">If needed, you can <a href="#compilation" title="documentation:2.0:applications:tomcat ↵" class="wikilink1">recompile the valve from the sources</a>.
|
|
</div></p>
|
|
</p>
|
|
|
|
</div>
|
|
<!-- EDIT3 SECTION "Installation" [1078-1310] -->
|
|
<h2 class="sectionedit4" id="configuration">Configuration</h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
Add on your <code>server.xml</code> file a new valve entry like this (in host section):
|
|
</p>
|
|
<pre class="code file xml"><span class="sc3"><span class="re1"><Valve</span> <span class="re0">className</span>=<span class="st0">"org.lemonLDAPNG.SSOValve"</span> <span class="re0">userKey</span>=<span class="st0">"AUTH-USER"</span> <span class="re0">roleKey</span>=<span class="st0">"AUTH-ROLE"</span> <span class="re0">roleSeparator</span>=<span class="st0">","</span> <span class="re0">allows</span>=<span class="st0">"127.0.0.1"</span><span class="re2">/></span></span></pre>
|
|
|
|
<p>
|
|
Configure attributes:
|
|
</p>
|
|
<ul>
|
|
<li class="level1"><div class="li"> <strong>userKey</strong>: key in the HTTP header containing user login.</div>
|
|
</li>
|
|
<li class="level1"><div class="li"> <strong>roleKey</strong>: key in the HTTP header containing roles. If <abbr title="LemonLDAP::NG">LL::NG</abbr> send some roles split by some commas, configure <strong>roleSeparator</strong>.</div>
|
|
</li>
|
|
<li class="level1"><div class="li"> <strong>roleSeparator</strong> (optional): role values separator.</div>
|
|
</li>
|
|
<li class="level1"><div class="li"> <strong>allows</strong> (optional): Define allowed remote <abbr title="Internet Protocol">IP</abbr> (use “,” separator for multiple <abbr title="Internet Protocol">IP</abbr>). Just set the <abbr title="LemonLDAP::NG">LL::NG</abbr> Handler <abbr title="Internet Protocol">IP</abbr> on this attribute in order to add more security. If this attribute is missed all hosts are allowed.</div>
|
|
</li>
|
|
<li class="level1"><div class="li"> <strong>passThrough</strong> (optional): Allow anonymous access or not. When it takes “false”, HTTP headers have to be sent by <abbr title="LemonLDAP::NG">LL::NG</abbr> to make authentication. So, if the user is not recognized or HTTP headers not present, a 403 error is sent.</div>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>
|
|
<p><div class="notetip">For debugging, this valve can print some helpful information in debug level. See <a href="http://tomcat.apache.org/tomcat-5.5-doc/logging.html" class="urlextern" title="http://tomcat.apache.org/tomcat-5.5-doc/logging.html" rel="nofollow">how configure logging in Tomcat</a> .
|
|
</div></p>
|
|
</p>
|
|
|
|
</div>
|
|
<!-- EDIT4 SECTION "Configuration" [1311-2481] -->
|
|
<h2 class="sectionedit5" id="compilation">Compilation</h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
The sources are available on <a href="../../../download.html#contributions" class="wikilink1" title="download">download page</a>.
|
|
</p>
|
|
|
|
<p>
|
|
Required :
|
|
</p>
|
|
<ul>
|
|
<li class="level1"><div class="li"> ant</div>
|
|
</li>
|
|
<li class="level1"><div class="li"> jre > 1.4</div>
|
|
</li>
|
|
<li class="level1"><div class="li"> tomcat >= 5.5</div>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Configure your tomcat home in <code>build.properties</code> files.
|
|
</p>
|
|
|
|
<p>
|
|
<p><div class="noteimportant">
|
|
Be careful for Windows user, path must contains “/”. Example:
|
|
</p>
|
|
<pre class="code">c:/my hardisk/tomcat/</pre>
|
|
|
|
<p>
|
|
|
|
</div></p>
|
|
</p>
|
|
|
|
<p>
|
|
Next run ant command:
|
|
</p>
|
|
<pre class="code">ant</pre>
|
|
|
|
<p>
|
|
<code>ValveLemonLDAPNG.jar</code> is created under <code>/dist</code> directory.
|
|
</p>
|
|
|
|
</div>
|
|
</div><!-- closes <div class="dokuwiki export">--> |