Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Spring security using JPA. How to configure applicationContext-security.XML file?(using DaoAuthenticationProvider)
- <authentication-provider>
- <jdbc-user-service id="userDetailsService" data-source-ref="dataSource" />
- </authentication-provider>
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
- <property name="driverClassName" value="com.mysql.jdbc.Driver" />
- <property name="url" value="jdbc:mysql://localhost:3306/demodata" />
- <property name="username" value="root"/>
- <property name="password" value="root"/>
- </bean>
- <beans:bean id="daoAuthenticationProvider" class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
- <property name="userDetailsService" ref="userDetailsService"/>
- <property name="saltSource" ref bean="saltSource"/>
- <property name="passwordEncoder" ref="passwordEncoder"/>
- </beans:bean>
- <authentication-provider user-service-ref="CustomUserDetailsService">
- </authentication-provider>
- <beans:bean id="CustomUserDetailsService" class="com.service.CustomUserDetailsService" />
- <beans:bean id="authenticationManager"
- class="org.springframework.security.providers.ProviderManager">
- <beans:property name="providers"><beans:list>
- <beans:ref local="daoAuthenticationProvider" />
- </beans:list> </beans:property>
- <beans:property name="sessionController"
- ref="defaultConcurrentSessionController" />
- </beans:bean>
- <beans:bean id="daoAuthenticationProvider"
- class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
- <property name="userDetailsService" ref="CustomUserDetailsService"/>
- <property name="saltSource" ref bean="saltSource"/>
- <property name="passwordEncoder" ref="passwordEncoder"/>
- </beans:bean>
- <authentication-provider user-service-ref="CustomUserDetailsService">
- </authentication-provider>
- <beans:bean id="CustomUserDetailsService"
- class="com.service.CustomUserDetailsService" />
- <beans:bean id="CustomUserDetailsService" class="com.service.CustomUserDetailsService">
- <custom-authentication-provider/>
- </beans>
Add Comment
Please, Sign In to add comment