Hi @sravya shivapuram ,
Thanks for reaching out.
I understand that you have requirement to acquire token continuously to access each Sharepoint site and Microsoft Identity is throttling your requests.
When application acquire token without waiting, they can produce a heavy load on the infrastructure and continue to be throttled. This will prevent your application from receiving tokens and your application responds with HTTP 429 - Too Many Requests response code.
We recommend implementing an exponential back-off retry with the first retry at least after few seconds after the response. In this approach, a client application periodically retries a failed request with increasing delays between requests.
Retry =
{
Delay= TimeSpan.FromSeconds(2),
MaxDelay = TimeSpan.FromSeconds(16),
MaxRetries = 5,
Mode = RetryMode.Exponential
}
Example:
1.Make request to services.
2.If the request fails, wait 1 seconds and retry the request.
3.If the request fails, wait 2 seconds and retry the request.
4.If the request fails, wait 4 seconds and retry the request.
5.If the request fails, wait 8 seconds and retry the request.
6.If the request fails, wait 16 seconds and retry the request.
The wait time is min (2^n), with n incremented by 1 for each request.
This will help to avoid throttling and acquire token correctly.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.