# ssjwt **Repository Path**: meng__lv/ssjwt ## Basic Information - **Project Name**: ssjwt - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-10 - **Last Updated**: 2021-06-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This is a certification center,Used for login and account registration for all projects; It uses springSecurity and java web token,At least jdk1.8+ ,Package via maven; Docking method: one:Entrust all login and registration to the certification center; 1、Add an interceptor to the project that needs to be docked, 1.1 Anything that does not contain token in the request header will be redirected(for example:127.0.0.1:8888/loginPage/{url}); url:The page that needs to be redirected after a successful login, And need to use base64 encryption; 1.2 When the authentication center carries the successfully logged-in token and jumps to the specified address, you need to save the token to the local localStore(html5), And every subsequent request needs to add the token to the request header。 2、Parse the jwt token in the request header in your interceptor to obtain user information, token issuance time, expiration time, and start your business; tow: Only use the certificate authority to verify users; 1、Encapsulate username and password,example:{username:xxx,password:xxx}, 2、Request for url 'http://${this server address}:${port}/login/{url}' url:The page that needs to be redirected after a successful login。 for example: ajax{ url:127.0.0.1:888/login/url, data:{ username:lbx123, password:123123 }, function(res){ if(res.code===200){ windows.localStore.setItem('token',res.data) /** start Your Logic **/ } } } Return format:{code:200,msg:'LOGIN_SUCCESS',data:token} 3、Accept the jwt token in the callback address server, choose any unknown to save it,and any request need take along this token in heard; About cancellation or expiration time: only need delete token in your local;and verify the expiration time in the token explanation:if you have any question please send email for me,342561749@qq.com