代码拉取完成,页面将自动刷新
包含鉴权服务 auth-service,网关服务 gateway-service,业务层 api-service
所有服务基于 spring boot 2.2.0.RELEASE & spring cloud Hoxton.M3 进行开发。
/.well-known/jwks.json
端点依次运行 auth-service,gateway-service,api-service
curl -X POST \
http://localhost:8081/oauth/token \
-d grant_type=password \
-d client_id=test-client \
-d client_secret=test-secret \
-d username=my-username \
-d password=my-password
# 将接口返回的 access_token 赋值给 shell 变量,方便后续引用
access_token_here=eyJhb...
curl -X GET http://localhost:8082/api/hello -sI
curl -X GET \
http://localhost:8082/api/hello \
-H "Authorization: Bearer ${access_token_here}"
# 直接访问 auth-service 接口
curl -X GET \
http://localhost:8081/users/me \
-H "Authorization: Bearer ${access_token_here}"
# 或者通过 gateway 访问 auth-service 接口
curl -X GET \
http://localhost:8082/auth/users/me \
-H "Authorization: Bearer ${access_token_here}"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。