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 的实现

 

 

 

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