Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is an example of securityContext.xml configuration file using custom autenticationFilter (extending AUTHENTICATION_PROCESSING_FILTER) and authenticationProvider. The user authentication data is provided by jdbc connection. Configuration is for Spring Security 2.0.x</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;sec:global-method-security /&gt; &lt;sec:http auto-config="false" realm="CUSTOM" create-session="always" servlet-api-provision="true" entry-point-ref="authenticationProcessingFilterEntryPoint" access-denied-page="/notauthorized.xhtml" session-fixation-protection="migrateSession"&gt; &lt;sec:port-mappings&gt; &lt;sec:port-mapping http="80" https="443" /&gt; &lt;/sec:port-mappings&gt; &lt;sec:anonymous granted-authority="ROLE_ANONYMOUS" username="Anonymous" /&gt; &lt;sec:intercept-url pattern="/**" access="ROLE_ANONYMOUS, ROLE_USER" /&gt; &lt;sec:logout logout-url="/logoff" logout-success-url="/home.xhtml" invalidate-session="false" /&gt; &lt;/sec:http&gt; &lt;bean id="authenticationProcessingFilterEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint"&gt; &lt;property name="loginFormUrl" value="/login.xhtml" /&gt; &lt;property name="forceHttps" value="false" /&gt; &lt;/bean&gt; &lt;bean id="authenticationProcessingFilter" class="mypackage.CustomAuthenticationProcessingFilter"&gt; &lt;sec:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" /&gt; &lt;property name="defaultTargetUrl" value="/" /&gt; &lt;property name="filterProcessesUrl" value="/logon" /&gt; &lt;property name="authenticationFailureUrl" value="/loginError.xhtml" /&gt; &lt;property name="alwaysUseDefaultTargetUrl" value="false" /&gt; &lt;property name="authenticationManager" ref="authenticationManager" /&gt; &lt;/bean&gt; &lt;jee:jndi-lookup id="securityDataSource" jndi-name="jdbc/DB_DS" /&gt; &lt;bean id="myUserDetailsService" class="mypackage.CustomJdbcDaoImpl"&gt; &lt;property name="dataSource" ref="securityDataSource" /&gt; &lt;property name="rolePrefix" value="ROLE_" /&gt; &lt;/bean&gt; &lt;bean id="apcAuthenticationProvider" class="mypackage.CustomDaoAuthenticationProvider"&gt; &lt;property name="userDetailsService" ref="myUserDetailsService" /&gt; &lt;sec:custom-authentication-provider /&gt; &lt;/bean&gt; &lt;bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager"&gt; &lt;property name="providers"&gt; &lt;list&gt; &lt;ref local="apcAuthenticationProvider" /&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/beans&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload