2016-10-15 19:57:54 +02:00
<!DOCTYPE html>
< html lang = "fr" dir = "ltr" >
< head >
< meta http-equiv = "content-type" content = "text/html; charset=UTF-8" >
< meta charset = "utf-8" / >
2017-02-07 17:35:26 +01:00
< title > documentation:2.0:applications:spring< / title > <!-- //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 --><!-- //endif -->
2016-10-15 19:57:54 +02:00
< 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
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.css" / >
2016-10-15 19:57:54 +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 >
2017-02-07 17:35:26 +01:00
< script type = "text/javascript" charset = "utf-8" src = "../lib/exe/js.php.t.bootstrap3.js" > < / script > <!-- //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
< script type = "text/javascript" src = "/lib/scripts/jquery-ui.min.js" > < / script >
//else -->
< script type = "text/javascript" src = "/lib/scripts/jquery-ui.js" > < / script > <!-- //endif -->
2016-10-15 19:57:54 +02:00
< / head >
< body >
< div class = "dokuwiki export container" >
< h1 class = "sectionedit1" id = "spring_security_acegi" > Sécurité Spring (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" > Présentation< / 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 > est le nouveau nom d'ACEGI. C'est le très connu framework de sécurité des applications J2EE.
< / p >
< p >
Spring Security fournit un mécansime de < code > pre-authentification< / code > par défaut qui peut être utilisé pour connecter une application J2EE à < 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 >
Les informations appropriées se trouvent ici : < 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 >
En résumé, pour connecter les utilisateurs vie l'entête HTTP < code > Auth-User< / code > , utiliser cette configuration de Spring Security :
< / 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 >