Extend DefaultHttpProvider to auto-refresh token while handling ErrorResponse
Expected behavior
Implementation of IHttpProvider class which gives the capability to handle Token Invalidation Errors within the class itself. Consider a Scenario, wherein you can pass RefreshToken to the HttpProvider Impl class during initialization. so that while handling the error response in 'handleErrorResponse' method , if an Invalid Token is detected, We could refresh the token and if successfull retry the request. This all abstracts the complexity of detecting the token expiry down the line and then having to recreate the api request What do you guys think?
Actual behavior
Steps to reproduce the behavior
Hi, @zeeshan-v1 Thanks for creating this issue, these scenarios are taken care by auth library. We will look into meeting your requirement in our auth library - https://github.com/microsoftgraph/msgraph-sdk-java-auth
Hi @zeeshan-v1 Thanks for reaching out and for the patience. With the release of the v3 of the java SDK, it now integrates with Azure Identity which supports a wide variety of authentication flows out of the box. We strongly encourage you to migrate to this v3 + azure identity, and you can read more about it in this issue. https://github.com/microsoftgraph/msgraph-sdk-java/issues/628
This issue won't be fixed, but I'll leave it open for visibility, and the repository will be archived soon.