shiro認證授權過程

2021-08-10 12:46:17 字數 806 閱讀 6945

οnclick="formsubmit('$/login.action','_self');"---》

public string login() throws exception---》

subject.login(token);//當這一**執行時,就會自動跳入到authrealm中認證方法---》

protected authenticationinfo dogetauthenticationinfo(authenticationtoken token)---》

authenticationinfo info = new ******authenticationinfo(user,user.getpassword(),this.getname());

return info;   //此處如果返回,就會立即進入到密碼比較器----》

public boolean docredentialsmatch(authenticationtoken token, authenticationinfo info) ----》

如果密碼相等,就從shiro中取出使用者的登入資訊

user user = (user) subject.getprincipal();

將使用者放入session域中

session.put(sysconstant.current_user_info, user);----》

//授權   當jsp頁面出現shiro標籤時,就會執行授權方法

protected authorizationinfo dogetauthorizationinfo(principalcollection pc)

shiro認證授權

1.shiro配置類 1.1需要配置什麼?建立乙個shirofilte ctorybean物件,檢測認證 向bean中傳入securitymanager物件 沒有認證的時候應該訪問哪個url位址 setloginurl 哪些資源是可以被匿名訪問的 setfilterchaindefinitionma...

shiro 實現認證授權

一.認證和授權的概念 認證 authentication show it,you are you 授權 authoriziation through it,you can do sth 二.shiro中的認證與授權 authenticatingrealm shiro中的用於進行認證的領域,實現dog...

Shiro認證過程

應用程式 呼叫 subject.login 方法,傳遞建立好的包含終端使用者的 principals 身份 和 credentials 憑證 的 authenticationtoken 例項 subject 例項 通常為 delegatingsubject 或子類 委託應用程式的 securitym...