Spring Security Custom Authentication and Password Encoding

前端 未结 3 887
陌清茗
陌清茗 2021-01-30 05:14

Is there a tutorial out there or does anyone have pointers on how to do the following with Spring-Security?

Task:

I need to get the salt from my

相关标签:
3条回答
  • 2021-01-30 05:34

    I'll mark this as answered, as I solved my problem and no other comments or answers were given:

    Edit 1 - Alternative 1 answers the original question

    BUT I had to learn that customized password salting is a legacy approach that is not needed in Spring Security 3.1 any more, as I describe in

    Edit 3 where I left some pointers on how to use the StandardPasswordEncoder for automated Salts that are stored with the password.

    0 讨论(0)
  • 2021-01-30 05:41

    For what it's worth, I wrote this blog post detailing what you've described: http://rtimothy.tumblr.com/post/26527448708/spring-3-1-security-and-salting-passwords

    0 讨论(0)
  • 2021-01-30 05:49

    To retrieve the global salt from a bean, use the Spring Expression Language or SpEL.

    <beans:bean id="encoder" 
            class="org.springframework.security.crypto.password.StandardPasswordEncoder">
        <constructor-arg value="#{someotherBean.somePropertyWithAGetterMethod"/>
    </beans:bean>
    
    0 讨论(0)
提交回复
热议问题