juhanakristian / remix-auth-microsoft

Microsoft authentication strategy for remix-auth
MIT License
41 stars 19 forks source link

💡Feature idea: allow user to pass `agent` & other values from `RequestExtraOptions` to `fetch` used internally #9

Open cliffordfajardo opened 2 years ago

cliffordfajardo commented 2 years ago

Scenario

At work, our server's are not allowed to make requests to the external world / internet , unless they go through a specific proxy server for security reasons.

When I was doing my work locally everything worked fine, but it wasn't until I deployed to production remix-auth-microsoft didn't work as expected. This was because remix-auth-microsoft makes API calls directly login.microsoft.com and graph.microsoft.com, which unfortunately is not permitted on our infra.

Feature Suggestion

Allow user to pass an optional RequestExtraOptions values to the options object that both the fetch and Request API use.

Temporary Solution

To resolve this challenge for my project, I copied the src/index.ts file from this repo, which contains the whole implementation of the remix-auth-microsoft package. Then I modified it per the suggestions of Sergio (creator of core remix-auth packages). Discord thread of his suggestions

Modified index.ts file (originally copied all of src/index.ts from this repo)

References / Related

cliffordfajardo commented 2 years ago

I think this change would be fairly easy & might not be a breaking change, I need to think about it a bit more though; simply wanted to post all my thoughts before I forget

juhanakristian commented 2 years ago

Hi @cliffordfajardo

This seems like a good feature to have and if you open a PR I'll be happy to merge it 👍

manzaloros commented 2 months ago

Has there been any update on this? I would love to be able to pass these extra options as well. Without this flexibility we can't use this library in production.