Don't allow direct calls to Microservices. Only allow through API Gateway

前端 未结 5 1627
走了就别回头了
走了就别回头了 2020-12-25 13:06

Maybe this is a strange question (I\'m new with Microservices). But I\'m looking for some info on how proceed with this. Does not need to be Spring specific, but that\'s the

5条回答
  •  一整个雨季
    2020-12-25 13:52

    Generally, such kind of situation are handled by implementing proper OAuth server wherein only your API gateway will handle the token validation. Any direct call to microservice will not have proper token exchange and hence requests will be aborted.

    In case, you have deployed your micro-services on any cloud then you can acheive this by exposing routes to only API gateway. And yes, firewall blocking, IP whitelisting are some of the other ways in restricting the access to your microservices.

提交回复
热议问题