[汇总]关于JWT扩展思考
如果accessToken放Client端,refreshToken存储在服务器,那么会违背微服务的无状态构架初衷。 accessToken和refreshToken统一放在Client端,可以遵循微服务无状态构架。 两种情况都可以通过accessToken来延长refreshToken,做到长时间保持登录状态的需求。
Just One Pure ITer
Authorization / Session Cross Domain & SSO
by leelight · Published October 27, 2020 · Last modified December 15, 2022
如果accessToken放Client端,refreshToken存储在服务器,那么会违背微服务的无状态构架初衷。 accessToken和refreshToken统一放在Client端,可以遵循微服务无状态构架。 两种情况都可以通过accessToken来延长refreshToken,做到长时间保持登录状态的需求。
一、单点登录简介 假设一个场景:公司内部有财务、OA、订单服务等各类相互独立的应用系统,员工张三对这些系统有操作权限,如果张三想要登录某个系统进行业务操作,那么他需要输入相应的账号与密码。想象一下,当公司内部有 100 个应用系统,张三是不是要输入 100 次用户名和密码进行登录,然后分别才能进行业务操作呢?显然这是很不好的体验,因此我们需要引入一个这样的机制:张三只要输入一次用户名和密码登录,成功登录后,他就可以访问财务系统、OA 系统、订单服务等系统。这就是单点登录。
Follow:
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |