flowable工作流引擎-flowable-modeler 登錄源碼分析

基於 flowable-6.5.1 版本

flowable-modeler  啓動後,訪問連接 http://localhost:8888/flowable-modeler/   將會跳轉到 flowable-idm 登錄頁面

在 flowable-ui-modeler-conf 的 SecurityConfiguration 添加 filter ,對請求進行攔截

 

 在 FlowableCookieFilter 進入 doFilterInternal 攔截方法,然後進入 redirectOrSendNotPermitted 方法,

 

然後進入 FlowableCookieFilter 的  redirectToLogin 方法,拼裝 url  跳轉到 idm 的登錄頁面  

http://localhost:8080/flowable-idm/#/login?redirectOnAuthSuccess=true&redirectUrl=http://localhost:8888/flowable-modeler/

 

跳轉到 登錄界面

 

getLoginPage 方法獲取到需要跳轉到的登錄頁面

前端 angular 匹配 /login  路徑,然後跳轉到 views/login.html

最後跳轉到 login 頁面,這個頁面可以做 logo 的修改,可以定製爲本公司的logo

 

 

輸入賬號密碼,根據配置類,將進入 /app/authentication  進行認證,認證成功後進入ajaxAuthenticationSuccessHandler 進行處理

認證成功後,進入spring-security 的 AbstractAuthenticationProcessingFilter 類,進入其 successfulAuthentication 方法,  successHandler 就是配置類的 ajaxAuthenticationSuccessHandler  的實例。

ajaxAuthenticationSuccessHandler 處理類的onAuthenticationSuccess方法,其實就是返回 200 的狀態碼給前端

進入到前端頁面的 authentication-service.js ,由於是 200 狀態碼,並且  url 

http://localhost:8080/flowable-idm/#/login?redirectOnAuthSuccess=true&redirectUrl=http://localhost:8888/flowable-modeler/

裏面 redirectOnAuthSuccess = true ,  將會觸發 auth-authConfirmed 

進入到前端的 idm-app.js  的 auth-authConfirmed  ,觸發 $window.location.href = redirectUrl;   

跳轉 回  http://localhost:8888/flowable-modeler/

界面顯示的導航菜單欄,是 mainNavigation 遍歷出來的

 

mainNavigation  是 app.js 定義的數組,如果不需要太多,可以自行修改定製。

 

到此,整個登錄過程結束

 spring-security 參考

https://blog.csdn.net/ZY_cookie/article/details/49535413?utm_source=blogxgwz1 的實現

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章