架构图

功能介绍
增加 webSocket 接口的通用鉴权拦截器,使用方式如下:
@ServerEndpoint(value = "/websocket/test", configurator = WcAuthConfigurator.class)
在 @ServerEndpoint 注解中添加 configurator 参数,指定 WcAuthConfigurator.class
详细请参考样例工程
websocket-demo
在 contoller、service 或者 dao 层使用以下方法:
SysUser user = LoginUserContextHolder.getUser()
需要服务满足以下两个条件:
zlt-auth-client-spring-boot-starter 依赖只会对 http 请求进行拦截鉴权。
对于其他协议如 webSocket、dubbo、MQ等如果需要进行 token 鉴权,可手动使用以下方法:
SysUser user = AuthUtils.checkAccessToken(String accessTokenValue)
增加工程 resources-server-demo 以最简化的代码演示如何快速集成一个带鉴权功能的服务,适用于 无网络隔离 架构。
对于
无网络隔离架构,每个暴露http接口服务都需要进行access_token鉴权。
由于 Security 默认的机制,只要请求携带了 access_token 参数,无论是否配置了排除鉴权,都必定会进行鉴权;
新版本解决了上述问题。
Gitee地址:https://gitee.com/zlt2000/microservices-platform
Github地址:https://github.com/zlt2000/microservices-platform
https://www.kancloud.cn/zlt2000/microservices-platform/919417
https://www.kancloud.cn/zlt2000/microservices-platform/936235