-
Notifications
You must be signed in to change notification settings - Fork 553
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
我在go-zero中集成go-oauth2后,如何跨服务验证token #248
Comments
把oauth当请求服务。然后所有的都走api中间件验证就可以了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我使用最新版的go-zero开发了go微服务,服务如下:
account-api
admin-api
go-oauth2是集成在account-api端的,按照官方的文档已经成功集成,现在的问题是,
在前端(vue开发的前端)访问account-api/account/info接口
这个接口使用下面的代码验证前端携带的token,可以正常验证并通过
CheckToken的封装是根据https://github.com/llaoj/oauth2nsso/blob/master/main.go#L273C8-L273C8进行的
现在在前端使用同样的请求头请求admin-api/system/info接口,接口使用同样的代码
报invalid access token错误
如何解决跨服务验证token,还请指点
The text was updated successfully, but these errors were encountered: