| 1 |
Spring Security (ACEGI) |
| 2 |
======================= |
| 3 |
|
| 4 |
|image0| |
| 5 |
|
| 6 |
Presentation |
| 7 |
------------ |
| 8 |
|
| 9 |
`Spring |
| 10 |
Security <http://static.springsource.org/spring-security/site/>`__ is |
| 11 |
the new ACEGI name. This is a well known security framework for J2EE |
| 12 |
applications. |
| 13 |
|
| 14 |
Spring Security provides a default ``pre-authentication`` mechanism that |
| 15 |
can be used to connect your J2EE application to LL::NG. |
| 16 |
|
| 17 |
Configuration |
| 18 |
------------- |
| 19 |
|
| 20 |
You can find all suitable information here: |
| 21 |
http://static.springsource.org/spring-security/site/docs/3.0.x/reference/preauth.html |
| 22 |
|
| 23 |
To summarize, to get the user connected through the ``Auth-User`` HTTP |
| 24 |
Header, use this Sping Security configuration: |
| 25 |
|
| 26 |
.. code-block:: xml |
| 27 |
|
| 28 |
<bean id="LemonLDAPNGFilter" class= |
| 29 |
"org.springframework.security.web.authentication.preauth.header.RequestHeaderPreAuthenticatedProcessingFilter"> |
| 30 |
<security:custom-filter position="PRE_AUTH_FILTER" /> |
| 31 |
<property name="principalRequestHeader" value="Auth-User"/> |
| 32 |
<property name="authenticationManager" ref="authenticationManager" /> |
| 33 |
</bean> |
| 34 |
|
| 35 |
<bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider"> |
| 36 |
<security:custom-authentication-provider /> |
| 37 |
<property name="preAuthenticatedUserDetailsService"> |
| 38 |
<bean id="userDetailsServiceWrapper" class="org.springframework.security.userdetails.UserDetailsByNameServiceWrapper"> |
| 39 |
<property name="userDetailsService" ref="userDetailsService"/> |
| 40 |
</bean> |
| 41 |
</property> |
| 42 |
</bean> |
| 43 |
|
| 44 |
<security:authentication-manager alias="authenticationManager" /> |
| 45 |
|
| 46 |
.. |image0| image:: /applications/spring_logo.png |
| 47 |
:class: align-center |
| 48 |
|