Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Spring Secuirty file to configure url-patterns, login, logout and error page. Configure handler for successful and unsuccessful login. Authentication manager and provider.
<beans:beans xmlns=""
xmlns:beans="" xmlns:xsi=""
<http auto-config="true">
<intercept-url pattern="/login" access="permitAll" />
<intercept-url pattern="/admin**" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<form-login login-page="/login"
authentication-failure-handler-ref="customAuthenticationFailureHandler" />
<access-denied-handler error-page="/accessDenied" />
<logout logout-url="/logout" logout-success-url="/login?logout" />
<authentication-manager alias="authenticationManager">
<authentication-provider user-service-ref="userService"/>

This comment has been minimized.

Copy link
Owner Author

bytestree commented May 6, 2016

Refer Spring Security 4 with Hibernate for complete example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.