zoukankan      html  css  js  c++  java
  • PasswordEncoder in spring security 5

    1 {bcrypt}$2a$10$vCXMWCn7fDZWOcLnIEhmK.74dvK1Eh8ae2WrWlhr2ETPLoxQctN4.
    2 {noop}plaintextpassword
    1 @Bean
    2 public PasswordEncoder passwordEncoder() {
    3     return PasswordEncoderFactories.createDelegatingPasswordEncoder();
    4 }
     1 public static PasswordEncoder createDelegatingPasswordEncoder() {
     2     String encodingId = "bcrypt";
     3     Map<String, PasswordEncoder> encoders = new HashMap<>();
     4     encoders.put(encodingId, new BCryptPasswordEncoder());
     5     encoders.put("ldap", new org.springframework.security.crypto.password.LdapShaPasswordEncoder());
     6     encoders.put("MD4", new org.springframework.security.crypto.password.Md4PasswordEncoder());
     7     encoders.put("MD5", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("MD5"));
     8     encoders.put("noop", org.springframework.security.crypto.password.NoOpPasswordEncoder.getInstance());
     9     encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
    10     encoders.put("scrypt", new SCryptPasswordEncoder());
    11     encoders.put("SHA-1", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-1"));
    12     encoders.put("SHA-256", new org.springframework.security.crypto.password.MessageDigestPasswordEncoder("SHA-256"));
    13     encoders.put("sha256", new org.springframework.security.crypto.password.StandardPasswordEncoder());
    14 
    15     return new DelegatingPasswordEncoder(encodingId, encoders);
    16 }

    https://blog.marcosbarbero.com/password-encoder-migration-spring-security-5/

  • 相关阅读:
    右滑返回上一页
    flutter 启动图
    [题解]NOIP2014
    [题解]LightOJ1289 LCM from 1 to n
    [题解]CodeForces442B Andrey and Problem
    [题解]HDU4035 Maze
    [题解]CodeForces#290(div1)
    SCP-bzoj-1078
    SCP-bzoj-1068
    SCP-bzoj-1054
  • 原文地址:https://www.cnblogs.com/bear129/p/13626084.html
Copyright © 2011-2022 走看看