I am New on Spring Security.using Spring 4.3 and Spring Security 5.0 .Everything Run .the login page also came .if you given Wrong Password it tells Your login attempt was not successful, try again.Fine But Right Password give it raised Exception
my Spring_Security . XML is
<authentication-manager>
<authentication-provider>
<user-service>
<user name="admin" password="1234" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
my Web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring-security.xml,
/WEB-INF/spring/appServlet/hibernate.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/appServlet/servlet-context.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
my Controller Class
@RequestMapping(value="/admin", method=RequestMethod.GET)
public String privateHome() {
return "privatePage";
}
When Run the Code /admin page its default run log in page .Everything Fine
.Once Right Credentials Given i got There is no Password Encoder mapped for the id "null"