Hello @Anonymous , you can use a proxy to communicate with Azure AD. That beind said a transparent proxy it's your best best since it does not modify the requests. Take a look to Microsoft 365 Common and Office Online for more information on endpoints that would need to work trough the proxy.
Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.