Java – more than one userdetailsservice is registered Please use a specific ID to reference or element

I tried to use spring security to remember my functions

<bean id="userService" class="mypath.service.UserDetailsServiceImpl" />

<security:http auto-config='true'>
  <security:intercept-url pattern="/Login" filters="none" />
  <security:form-login login-page='/Login' authentication-failure-url="/Login?login_error=1"/>
  <security:remember-me data-source-ref="dataSource" />
</security:http>

However, I seem to have specified userservice somewhere in the remember me element? What should I do

The error I encountered when starting Tomcat is

More than one UserDetailsService registered. 
Please use a specific Id reference in <remember-me/> <openid-login/> or <x509 /> elements.

Solution

Well, it's not that hard, just in case others find spring documents quite difficult to navigate:

<security:remember-me data-source-ref="dataSource" user-service-ref="myUserService"/>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>