怎么解決SpringSecurity中的ThereisnoPasswordEncodermappedfortheid“null”問題

這篇文章主要講解了“怎么解決Spring Security中的There is no PasswordEncoder mapped for the id “null”問題”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“怎么解決Spring Security中的There is no PasswordEncoder mapped for the id “null”問題”吧!

成都創(chuàng)新互聯(lián)公司是專業(yè)的鹽城網(wǎng)站建設(shè)公司,鹽城接單;提供網(wǎng)站建設(shè)、網(wǎng)站制作,網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進行鹽城網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!

@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    logger.info("登陸用戶名:"+username);
    //根據(jù)用戶名查找  可以采用多種查詢數(shù)據(jù)庫 這里暫時先寫死了



    return new User(username,"123456", AuthorityUtils.commaSeparatedStringToAuthorityList("admin"));

出現(xiàn)問題  訪問的 登陸頁面 輸入錯誤 的 密碼  和 用戶名的時候 直接 返回錯誤  There is no PasswordEncoder mapped for the id “null”  

現(xiàn)在 采用這個 方法

return new User(username,"{noop}123456", AuthorityUtils.commaSeparatedStringToAuthorityList("{noop}admin"));

問題解決 怎么解決Spring Security中的There is no PasswordEncoder mapped for the id “null”問題

感謝各位的閱讀,以上就是“怎么解決Spring Security中的There is no PasswordEncoder mapped for the id “null”問題”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對怎么解決Spring Security中的There is no PasswordEncoder mapped for the id “null”問題這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!

文章名稱:怎么解決SpringSecurity中的ThereisnoPasswordEncodermappedfortheid“null”問題
轉(zhuǎn)載注明:http://www.muchs.cn/article30/gjgpso.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、品牌網(wǎng)站制作網(wǎng)站制作、面包屑導航、App開發(fā)搜索引擎優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作