场景重现:1.微信小程序向后台发送请求 ——而后台web采用的springSecuriry没有token生成,就会拦截请求,,所以小编记录下这个问题
微信小程序授权登录问题
思路
参考网上一大堆资料 核心关键字: 自定义授权+鉴权 (说的通俗就是解决办法就是改造springSecurity的过滤器)
参考文章
https://blog.csdn.net/qq_22606825/article/details/100047498?utm_medium=distribute.pc_relevant.none-task-blog-title-3&spm=1001.2101.3001.4242
总的来说的
通过自定义的WxAppletAuthenticationFilter替换默认的
UsernamePasswordAuthenticationFilter
,在UsernamePasswordAuthenticationFilter中可任意定制自己的登录方式。
springSecurity的原来的登录过滤器UsernamePasswordAuthenticationFilter
采用账户+密码的形式