C
C#2y ago
Messiah

❔ How do yall do HttpClient tokens?

I have a typed http client factory in ASP.NET that I need an OAuth2 token to be shared amongst this type. Is there a library for helping with this or do I have to code it manually? I'm guessing I can put the token in a memory cache, but how do I add the token to each request? Google-fu told me I could use a middleware, but this would regenerate the token with each request, instead of only when it's needed.
3 Replies
Sossenbinder
Sossenbinder2y ago
Refit can do that iirc
Messiah
MessiahOP2y ago
thanks
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?