74 lines
5.3 KiB
HTML
74 lines
5.3 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="spring_security_acegi">Spring Security (ACEGI)</h1>
|
|
<div class="level1">
|
|
|
|
<p>
|
|
<a href="/_detail/applications/spring_logo.png?id=documentation%3A2.0%3Aapplications%3Aspring" class="media" title="applications:spring_logo.png"><img src="../../../../media/icons/kmultiple.png" class="mediacenter" alt="" /></a>
|
|
</p>
|
|
|
|
</div>
|
|
<!-- EDIT1 SECTION "Spring Security (ACEGI)" [1-77] -->
|
|
<h2 class="sectionedit2" id="presentation">Presentation</h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
<a href="http://static.springsource.org/spring-security/site/" class="urlextern" title="http://static.springsource.org/spring-security/site/" rel="nofollow">Spring Security</a> is the new ACEGI name. This is a well known security framework for J2EE applications.
|
|
</p>
|
|
|
|
<p>
|
|
Spring Security provides a default <code>pre-authentication</code> mechanism that can be used to connect your J2EE application to <abbr title="LemonLDAP::NG">LL::NG</abbr>.
|
|
</p>
|
|
|
|
</div>
|
|
<!-- EDIT2 SECTION "Presentation" [78-394] -->
|
|
<h2 class="sectionedit3" id="configuration">Configuration</h2>
|
|
<div class="level2">
|
|
|
|
<p>
|
|
You can find all suitable information here: <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/preauth.html" class="urlextern" title="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/preauth.html" rel="nofollow">http://static.springsource.org/spring-security/site/docs/3.0.x/reference/preauth.html</a>
|
|
</p>
|
|
|
|
<p>
|
|
To summarize, to get the user connected trough the <code>Auth-User</code> HTTP Header, use this Sping Security configuration:
|
|
</p>
|
|
<pre class="code file xml"><span class="sc3"><span class="re1"><bean</span> <span class="re0">id</span>=<span class="st0">"LemonLDAPNGFilter"</span> <span class="re0">class</span>=</span>
|
|
<span class="sc3"><span class="st0">"org.springframework.security.web.authentication.preauth.header.RequestHeaderPreAuthenticatedProcessingFilter"</span><span class="re2">></span></span>
|
|
<span class="sc3"><span class="re1"><security:custom-filter</span> <span class="re0">position</span>=<span class="st0">"PRE_AUTH_FILTER"</span> <span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><property</span> <span class="re0">name</span>=<span class="st0">"principalRequestHeader"</span> <span class="re0">value</span>=<span class="st0">"Auth-User"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><property</span> <span class="re0">name</span>=<span class="st0">"authenticationManager"</span> <span class="re0">ref</span>=<span class="st0">"authenticationManager"</span> <span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"></bean<span class="re2">></span></span></span>
|
|
|
|
<span class="sc3"><span class="re1"><bean</span> <span class="re0">id</span>=<span class="st0">"preauthAuthProvider"</span> <span class="re0">class</span>=<span class="st0">"org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider"</span><span class="re2">></span></span>
|
|
<span class="sc3"><span class="re1"><security:custom-authentication-provider</span> <span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"><property</span> <span class="re0">name</span>=<span class="st0">"preAuthenticatedUserDetailsService"</span><span class="re2">></span></span>
|
|
<span class="sc3"><span class="re1"><bean</span> <span class="re0">id</span>=<span class="st0">"userDetailsServiceWrapper"</span> <span class="re0">class</span>=<span class="st0">"org.springframework.security.userdetails.UserDetailsByNameServiceWrapper"</span><span class="re2">></span></span>
|
|
<span class="sc3"><span class="re1"><property</span> <span class="re0">name</span>=<span class="st0">"userDetailsService"</span> <span class="re0">ref</span>=<span class="st0">"userDetailsService"</span><span class="re2">/></span></span>
|
|
<span class="sc3"><span class="re1"></bean<span class="re2">></span></span></span>
|
|
<span class="sc3"><span class="re1"></property<span class="re2">></span></span></span>
|
|
<span class="sc3"><span class="re1"></bean<span class="re2">></span></span></span>
|
|
|
|
<span class="sc3"><span class="re1"><security:authentication-manager</span> <span class="re0">alias</span>=<span class="st0">"authenticationManager"</span> <span class="re2">/></span></span></pre>
|
|
|
|
</div>
|
|
</div><!-- closes <div class="dokuwiki export">--> |