【问题标题】:Implement security only at ZUUL Gateway仅在 ZUUL 网关实现安全性
【发布时间】:2021-07-19 07:36:58
【问题描述】:

我有以下微服务架构(spring boot,java)。我只想在 ZUUL 网关上实现 OAUTH2 JWT 安全,而不是在微服务中复制安全代码。 假设微服务 1 有休息端点 http://localhost:8080/microservice-1/get/person 那么我不应该在微服务 1 中有任何安全代码,但同时没有人应该能够访问微服务 1无需传递 JWT 令牌直接休息端点,但它应该只能通过 ZUUL 访问。

【问题讨论】:

    标签: spring-boot microservices spring-cloud netflix-zuul spring-cloud-gateway


    【解决方案1】:

    您可以在 Zuul 网关中使用 WebSecurityConfigurerAdapter 类并为每个路由配置安全性。

    这对你来说是一个很好的例子

    https://medium.com/@bharatrajmeriyala/spring-cloud-security-with-netflix-zuul-2ef04a1dcfb

    【讨论】:

      猜你喜欢
      • 2018-06-22
      • 2011-04-12
      • 2017-08-11
      • 1970-01-01
      • 2020-07-14
      • 2017-11-21
      • 1970-01-01
      • 1970-01-01
      • 2018-03-20
      相关资源
      最近更新 更多