# springboot+springsecurity+jwt **Repository Path**: lonecheng/springboot-springsecurity-jwt ## Basic Information - **Project Name**: springboot+springsecurity+jwt - **Description**: springboot+springsecurity+jwt 安全认证项目 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2020-11-26 - **Last Updated**: 2021-09-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springboot+springsecurity+jwt #### 介绍 springboot+springsecurity+jwt安全认证项目 #### 软件架构 springboot+springsecurity+jwt #### 安装教程 1. 克隆下来,等待maven下载,springboot一键启动如此简单。 #### 使用说明 整合全过程的教程可访问我的博客:[SpringBoot2+SpringSecurity+JWT完成安全认证](https://blog.csdn.net/cheng137666/article/details/110194222)   首先这里要安利一个工具,谷歌浏览器的一个插件: **Talend API Tester** ,本人喜欢用这个而不是postman。   接下来真是进入测试环节: 1. 首先在没有token下,去访问 **/hello**,由于没有认证会因此返回认证失败。 ![在这里插入图片描述](https://img-blog.csdnimg.cn/20201126183355662.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NoZW5nMTM3NjY2,size_16,color_FFFFFF,t_70#pic_center) 2. 去访问登录接口 **/login** ,输入错误的密码(密码默认设置为123,在SecurityUserDetailService 有注释请自行查看),由于密码错误,由于密码错误因此依然返回认证失败,正常系统会在SecurityUserDetailService 进行密码验证,就可返回自定义的错误信息。 ![在这里插入图片描述](https://img-blog.csdnimg.cn/2020112618393199.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NoZW5nMTM3NjY2,size_16,color_FFFFFF,t_70#pic_center) 3. 去访问登录接口 **/login** ,输入正确的密码,成功返回了token ![在这里插入图片描述](https://img-blog.csdnimg.cn/20201126184011762.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NoZW5nMTM3NjY2,size_16,color_FFFFFF,t_70#pic_center) 4. 反正返回的token去再去访问 **/hello** ,你会发现已经可以正常访问了! ![在这里插入图片描述](https://img-blog.csdnimg.cn/20201126184123185.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NoZW5nMTM3NjY2,size_16,color_FFFFFF,t_70#pic_center) #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)