C
C#12mo 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
Sossenbinder12mo ago
Refit can do that iirc
Messiah
Messiah12mo ago
thanks
Accord
Accord12mo 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.