Spring Security 报:Encoded password does not look like BCrypt

这篇具有很好参考价值的文章主要介绍了Spring Security 报:Encoded password does not look like BCrypt。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

SpringBoot 集成 Security 时,报 Encoded password does not look like BCrypt
原因:SecurityConfig 必须 Bean 的形式实例化

/**
 * 配置用户身份的configure()方法
 *
 * @param auth
 * @throws Exception
 */
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
}

解决方案文章来源地址https://www.toymoban.com/news/detail-432701.html

/**
 * 强散列哈希加密实现 
 * 必须 Bean 的形式实例化,否则会报 :Encoded password does not look like BCrypt
 */
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder()
{
    return new BCryptPasswordEncoder();
}

/**
 * 配置用户身份的configure()方法
 *
 * @param auth
 * @throws Exception
 */
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
}

到了这里,关于Spring Security 报:Encoded password does not look like BCrypt的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • git报错The project you were looking for could not be found 解决方式

    一、拉代码报错The project you were looking for could not be found 问题描述: 使用git从远程仓库克隆项目到本地的时候。 出现这个问题:The project you were looking for could not be found. 原因分析: 你的账号没有项目的权限,你可以在浏览器输入你的项目地址,如果可以进入,则说明有权限;

    2024年02月04日
    浏览(52)
  • git克隆报错remote: The project you were looking for could not be found的解决方法

    在clone项目的时候克隆失败了,错误信息如下: remote: The project you were looking for could not be found. fatal: repository \\\' http://10.134.108.109/xxxx/snpb.git\\\' not found 原因是由于我的gitlab中有多个项目多个用户,我在克隆的时候系统还使用我之前的用户来连接,所以会报错。 解决方法: 在克隆

    2024年02月14日
    浏览(42)
  • git clone发生了remote: The project you were looking for could not be found的错误

    在用git从远程仓库克隆项目到本地的时候 发生了remote: The project you were looking for could not be found的错误,无法正确克隆项目 原因一般有两个: 一 是你没有项目的权限,你可以在浏览器输入你的项目地址,看能不能进去,如果可以进入,则说明有权限,这样的话一般错误原因在

    2024年02月11日
    浏览(46)
  • 特殊的bug:element 0 of tensors does not require grad and does not have a grad_fn

    很多帖子都说了,设置requires_grad_()就行。 但是我这次遇到的不一样,设置了都不行。 我是这种情况,在前面设置了 torch.no_grad(): ,又在这个的作用域下进行了 requires_grad_() ,这是不起作用的。 简单版: 这样子直接看,傻瓜都不会犯错。而我这个就比较隐蔽了。。。 我的:

    2024年02月03日
    浏览(34)
  • Spring Boot 中Mybatis使用Like的使用方式和注意点

           模糊查询在项目中还是经常使用的,本文就简单整理Mybatis中使用Like进行模糊查询的几种写法以及一些常见的问题。       使用Springboot简单配置一下Mybatis,然后进行说明。Springboot集成Mybatis这里就不做介绍了,这里我们主要介绍一下在mybatis配置文件中怎么使用模糊查

    2024年04月28日
    浏览(22)
  • xcode SDK does not contain ‘libarclite‘

    解决方法 iOS13以上

    2024年02月03日
    浏览(46)
  • PostgreSQL问题记录:column “...“ does not exist

    在PostgreSQL中,不论是在pgAdmin中,还是在命令行控制台里面,在SQL语句中表示属性值的总会遇到ERROR: column “…” does not exist这样的错误,比如下面的语句: 解决方案:将 “txt2txt” 的双引号改成 单引号 就行了。 问题原因:可能是被双引号括起来的,PostgreSQL都会认为是“名

    2024年02月05日
    浏览(83)
  • 解决git clone代码,报错remote: The project you were looking for could not be found or you don‘t

    git clone项目时,clone失败,错误信息如下: remote: The project you were looking for could not be found or you don\\\'t have permission to view it. fatal: repository \\\'https://119.23.248.3/xxxx/pad.git\\\' not found 由于我在没有账号前用的同事的账号进行clone代码,所以之后克隆的时候系统还使用我之前的用户来连接,

    2024年02月11日
    浏览(49)
  • Git:git clone报错The project you were looking for could not be found or you don‘t have ...

    一、git clone 项目,报错如下 remote: The project you were looking for could not be found or you don\\\'t have permission to view it. fatal: repository \\\'http://xxx.xxx.com/xxx_tools/xxx-frontend.git/\\\' not found 解决问题 在http://后增加 “用户名@” git clone http://userName@xxx.xxx.com/xxx_tools/xxx-frontend.git 经过测试,问题解决了

    2024年04月17日
    浏览(48)
  • 解决launch:program .exe does not exist

    二. 程序的运行和调试 1.launch.json 复制下列代码至launch.json,并根据指导做出相对/绝对路径修改 tasks.json 收纳生成的 exe 可执行文件 打开.vscode 文件夹下的 launch.json 文件,找到 “${fileDirname}${fileBasenameNoExtension}.exe” 修改成 “${fileDirname}coin${fileBasenameNoExtension}.exe” 并保存,同

    2024年02月03日
    浏览(34)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包