java - Reference a specific password-encoder in my security-config.xml -


i using spring security login authorization. in security-config.xml using following code:

  <authentication-manager>       <authentication-provider>        <password-encoder hash="md5"/>        <jdbc-user-service data-source-ref="datasource" users-by-            username-query="select username, password,1 enabled            users username=?" authorities-by-            username-query="select username, authority,1 enabled             users  username =?" />       </authentication-provider>   </authentication-manager> 

but in database have encrypted password using customized function not pure md5 hash. question can call function security-config.xml instead of

<password-encoder hash="md5"/> 

or if there way?

thank in advance.

you can register custom password encoder (create class implements passwordencoder) call customiwed function.

in xml, change :

<password-encoder hash="md5"/> 

with :

<password-encoder ref="passwordencoder">    

which passwordencoder name of class/bean implementing passwordencoder.

more details here or here.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -