Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use WebProxy with msal4j

Our daemons application is using msal4j 1.3 to get access token from https://login.microsoftonline.com/. However, in some of our customer's production environment, it is not possible to access https://login.microsoftonline.com directly. They want to use authenticated proxy to access it. Is it possible to set have msal4j to use a webProxy? If not, what is the suggestion for us to use msal4j with such a webProxy?

like image 464
Lin Chen Avatar asked Dec 06 '25 05:12

Lin Chen


1 Answers

Yes, you can have MSAL4J use a Proxy.

The most straightforward way would be by injecting the Http client that the application is using into MSAL. You would configure the proxy settings on the Http client, implement MSALs IHttpClient, and then pass in the implementation into MSAL when you instantiate the client application object. MSAL will then use this Http client for all requests. For more information, see the Configure Http Client wiki page

like image 145
sgonzalez Avatar answered Dec 07 '25 20:12

sgonzalez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!