avatar
Untitled

Guest 24 9th Oct, 2019

MARKUP 1.37 KB
                                           
                         <security:http auto-config="true">
		<security:intercept-url pattern="/admin*"
			access="ROLE_ADMIN" />
		<security:intercept-url pattern="/home*"
			access="ROLE_USER" />
		<security:form-login login-page="/login"
			default-target-url="/admin" authentication-failure-url="/error" />
		<security:access-denied-handler
			error-page="/403" />
		<security:logout logout-success-url="/logout" />
	</security:http>

	<security:authentication-manager>
		<security:authentication-provider>
			<security:password-encoder ref="bcryptPasswordEncoder" />
			<security:jdbc-user-service
				data-source-ref="dataSource"
				users-by-username-query="select username, password, enabled from users1 where username=?"
				authorities-by-username-query="select username, authority from authorities where username =?  " />
		</security:authentication-provider>
	</security:authentication-manager>

	<beans:bean id="bcryptPasswordEncoder"
		class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder">
		<beans:constructor-arg name="strength" value="10" />
	</beans:bean>
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes