Fixes to Overcome Circular Dependency in Authorization Flow
Fixes to Overcome Circular Dependency in Authorization Flow We are building a Spring Boot microservices project with multiple services like: user-service (manages user info) merchant-service (manages merchant info) Other services... Security Setup All services share a common library that: Validates tokens Loads user and merchant info by calling other services (user-service, merchant -service) The Problem: Circular Calls Here’s what’s going wrong: The common library in a service (e.g., merchant-service) calls the user-service to get user info. But user-service also uses the same common library, and it needs merchant info → so it calls back the merchant-service. This creates a circular REST call between services: merchant→ user → merchant→ user... This can lead to failures or stuck calls. Options You Proposed Option 1: Exclude endpoints from secu...