© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ How to do faster HttpClient requests?
C#CC# / help
4y ago
HTTPClient
C#CC# / help
2y ago
❔ HttpClient Error
C#CC# / help
3y ago
How to use certificate on HttpClient
C#CC# / help
4y ago