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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -