2016-10-15 19:57:04 +02:00
<!DOCTYPE html>
< html lang = "en" dir = "ltr" >
< head >
< meta charset = "utf-8" / >
< title > documentation:2.0:applications:spring< / title >
< meta name = "generator" content = "DokuWiki" / >
< meta name = "robots" content = "index,follow" / >
< meta name = "keywords" content = "documentation,2.0,applications,spring" / >
< link rel = "search" type = "application/opensearchdescription+xml" href = "../lib/exe/opensearch.html" title = "LemonLDAP::NG" / >
< link rel = "start" href = "spring.html" / >
< link rel = "contents" href = "spring.html" title = "Sitemap" / >
< link rel = "stylesheet" type = "text/css" href = "../lib/exe/css.php.t.bootstrap3.css" / >
2017-02-07 17:35:26 +01:00
<!-- //if:usedebianlibs
< link rel = "stylesheet" type = "text/css" href = "/javascript/bootstrap/css/bootstrap.min.css" / >
//elsif:useexternallibs
< link rel = "stylesheet" type = "text/css" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" > < / script >
//elsif:cssminified
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.min.css" / >
//else -->
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.css" / >
<!-- //endif -->
2016-10-15 19:57:04 +02:00
< script type = "text/javascript" > / * < ! [ C D A T A [ * / v a r N S = ' d o c u m e n t a t i o n : 2 . 0 : a p p l i c a t i o n s ' ; v a r J S I N F O = { " i d " : " d o c u m e n t a t i o n : 2 . 0 : a p p l i c a t i o n s : s p r i n g " , " n a m e s p a c e " : " d o c u m e n t a t i o n : 2 . 0 : a p p l i c a t i o n s " } ;
/*!]]>*/< / script >
< script type = "text/javascript" charset = "utf-8" src = "../lib/exe/js.php.t.bootstrap3.js" > < / script >
2017-02-07 17:35:26 +01:00
<!-- //if:usedebianlibs
< script type = "text/javascript" src = "/javascript/jquery/jquery.min.js" > < / script >
//elsif:useexternallibs
< script type = "text/javascript" src = "http://code.jquery.com/jquery-2.2.0.min.js" > < / script >
//elsif:jsminified
< script type = "text/javascript" src = "/static/bwr/jquery/dist/jquery.min.js" > < / script >
//else -->
< script type = "text/javascript" src = "/static/bwr/jquery/dist/jquery.js" > < / script >
<!-- //endif -->
<!-- //if:usedebianlibs
< script type = "text/javascript" src = "/javascript/jquery-ui/jquery-ui.min.js" > < / script >
//elsif:useexternallibs
< script type = "text/javascript" src = "http://code.jquery.com/ui/1.10.4/jquery-ui.min.js" > < / script >
//elsif:jsminified
2018-03-08 13:29:31 +01:00
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.min.js" > < / script >
2017-02-07 17:35:26 +01:00
//else -->
2018-03-08 13:29:31 +01:00
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.js" > < / script >
2017-02-07 17:35:26 +01:00
<!-- //endif -->
2016-10-15 19:57:04 +02:00
< / head >
< body >
< div class = "dokuwiki export container" >
< h1 class = "sectionedit1" id = "spring_security_acegi" > Spring Security (ACEGI)< / h1 >
< div class = "level1" >
< p >
< a href = "spring_logo.png_documentation_2.0_applications_spring.html" class = "media" title = "applications:spring_logo.png" > < img src = "spring_logo.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 >
<!-- EDIT3 SECTION "Configuration" [395 - ] --> < / div >
< / body >
< / html >