Spring Boot: How to specify the PasswordEncoder?

前端 未结 15 1151
醉梦人生
醉梦人生 2020-12-02 06:27

Currently I got the main class:

package com.recweb.springboot;

import org.springframework.boot.SpringApplication;
im         


        
15条回答
  •  死守一世寂寞
    2020-12-02 07:04

    Prefix all existing passwords with {noop} to keep the default encoder of Spring Security 5.

    Example:

    auth.inMemoryAuthentication()
        .withUser("admin").password("{noop}admin!234").roles("ADMIN");
    

提交回复
热议问题