huangfukexing的gravatar头像
huangfukexing 2019-10-15 12:07:32

springboot基于jwt完成服务的单点登录简单实例

项目描述

基于SpringBoot  jwt完成服务的单点登录问题

运行环境

jdk8+IntelliJ IDEA+maven

项目技术(必填)

SpringBoot+Jwt+html5+jquery

数据库文件

jar包文件

Maven运行

是否原创(转载必填原文地址)

项目截图(必填)

springboot基于jwt完成服务的单点登录简单实例

springboot基于jwt完成服务的单点登录简单实例

springboot基于jwt完成服务的单点登录简单实例

运行截图(必填)

如果没有登陆时访问http://localhost:8081/getUser时会跳转到http://localhost:8080/index?sourceUrl=http://localhost:8081/getUser登录

账号  123  密码  123

springboot基于jwt完成服务的单点登录简单实例

如果没有登陆时访问http://localhost:8082/getData时会跳转到http://localhost:8080/index?sourceUrl=http://localhost:8082/getData登录

springboot基于jwt完成服务的单点登录简单实例

http://localhost:8080/index?sourceUrl=http://localhost:8081/getUser输入账号后登陆成功

springboot基于jwt完成服务的单点登录简单实例

springboot基于jwt完成服务的单点登录简单实例

再次访问http://localhost:8082/getData时,已经同步登陆成功

springboot基于jwt完成服务的单点登录简单实例

访问 http://localhost:8080/outLogin退出登录,所有8081和8082的服务需要重新登录

springboot基于jwt完成服务的单点登录简单实例

注意事项

1.8080实现8081和8082两个服务的sso单点登录功能

2.8080,8081,8082都需要启动,启动顺序没有影响


打赏

已有1人打赏

最代码官方的gravatar头像

文件名:sso-demo.zip,文件大小:276.316K 下载
最代码最近下载分享源代码列表最近下载
zhujunnan  LV12 3月5日
heweimin  LV12 2022年7月8日
1234mama  LV19 2022年6月7日
sunlzh888888  LV28 2022年4月28日
taoshen95  LV14 2022年2月16日
lyws1986  LV17 2021年12月16日
Echo  LV2 2021年11月24日
孤寒双月泪  LV14 2021年11月21日
xiaoxindu8  LV9 2021年9月17日
lironggang  LV38 2021年8月16日
最代码最近浏览分享源代码列表最近浏览
zolscy  LV12 3月24日
hjjhhhh  LV4 2023年12月20日
漫步的海星  LV4 2023年9月26日
gggl_yugghh 2023年8月2日
暂无贡献等级
iceboard  LV2 2023年5月29日
1093358768  LV1 2023年3月26日
万盛拓海  LV2 2022年10月20日
zuoziju  LV8 2022年9月28日
xp95323  LV14 2022年9月21日
talete  LV3 2022年8月2日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友