Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否实现网关处理认证,服务处理权限校验 #569

Closed
Basil1991 opened this issue Jan 15, 2024 · 2 comments
Closed

能否实现网关处理认证,服务处理权限校验 #569

Basil1991 opened this issue Jan 15, 2024 · 2 comments

Comments

@Basil1991
Copy link

Basil1991 commented Jan 15, 2024

对以下问题有疑问:

我看了下sa-token的认证和授权其实是分开的,
想了解下sa-token能否实现在网关统一处理认证,在服务处理权限校验。目前处理权限校验的时候会和重复处理认证请求,这两者是否可以分离

@ly-chn
Copy link
Member

ly-chn commented Jan 18, 2024

没能理解, 是想说网关处只校验登录, 不校验权限. 然后子服务来校验权限, 这样吗. 大部分实现都是这样的吧, 可以在案例中找找https://sa-token.cc/doc.html#/more/link

比如ruoyi-vue-plus貌似就是这么弄的

@ly-chn ly-chn closed this as completed Jan 18, 2024
@Basil1991
Copy link
Author

@ly-chn 我的意思是我在gateway做了全局登入校验,但是在子服务中使用@CheckPermission注解之类的子服务也会进行一次登入校验。我希望节省这部分的成本,在子服务不用访问redis校验登入,而只直接利用sa-token的权限校验能力。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants