Spring Securityでパスワードエンコーディング未実施のパスワードを使う

ちょっとしたテストでインメモリユーザーを使う場合にエラーが発生する。

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

パスワードの前に{noop}を追加すればOK。

変更後

    @Autowired
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth
            .inMemoryAuthentication()
            .withUser("user").password("{noop}password").roles("USER");
    }

変更前

    @Autowired
    public void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth
            .inMemoryAuthentication()
            .withUser("user").password("password").roles("USER");
    }