User user=getPassWordByUserName(userName); if(user==null){ return null; } SimpleAuthenticationInfo authenticationInfo=new SimpleAuthenticationInfo(user.getUsername(),user.getPassword(),"customRealm");
SimpleAuthenticationInfo?authenticationInfo=new?SimpleAuthenticationInfo(user.getUsername(),user.getPassword(),"customRealm");
方法里面的userName和password以及自定義customRealm都分別是用來干嘛的???? 有點不是很理解
2019-01-08
這里的userName、password是從用戶從前端頁面提交過來的用戶名跟密碼,只是把用戶名密碼封裝為了一個簡單的認證對象,而customRealm在這塊應該沒有什么實際意義