I have written an API (lets call it API-1) which will call an internal API (lets call it API-2) in an iterative manner for getting the user details (The number of user details depends on the count I specify while making the call using API-1)
Here Internal API (API-2) will make a management API call for getting the details of a specific user using system admin credentials
Flow:
API-1(User details API - Iterative Call) --> API-2(Internal API - Single Call) --> Management API Call
For authentication purpose we are using an external IDP along with LDAP
I see that some of the calls made by API-2 to Management API are successful and some of them are failing. I find it difficult to understand as to why only some calls are failing with 401 Unauthorized issue , couldn't even find out a pattern too.
For example , I am expecting first 20 user details API- 1 will make a 20 iterative calls to API-2 to get User details.sometimes API- 2 is responding back with success for all the 20 calls and sometimes it is failing with 401 Unauthorized error even though there is no change in the Input data/headers