-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add target framework netstandard 2.0 so Auth0Net.DependencyInjection can be used in .NET Framework and .NET 5.0 #24
Add target framework netstandard 2.0 so Auth0Net.DependencyInjection can be used in .NET Framework and .NET 5.0 #24
Conversation
Whilst I appreciate the contribution, I'm not exactly thrilled that it's in the form of some tech debt.
Could you proxy the requests via a central API or is direct access a firm requirement? Are those projects using a modern enough IoC container to work with the extensions in this project (implements
Just a note that this will result in the client breaking if a DNS record gets changed, although that probably doesn't matter. |
@@ -0,0 +1,27 @@ | |||
// Original source code copied from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the use of Simon Cropp's Polyfill package than having this in the codebase.
Hi Hawxy, thanks for your review. The requests to Auth0 could be proxied over a new REST service, but this adds considerable overhead for us: A new service to build and maintain, new DNS entries for 4 environments, and a new pipeline to build and deploy the service to the environments. We would like to avoid this overhead, if possible. Since the Auth0 official packages do target I wasn't aware of the Polyfill package that you mentioned; I'll look into this shortly. Could you give some additional info regarding the DNS problem that System.Net.Http.SocketsHttpHandler solves? I'd be very interested what is all about. |
Gotcha.
https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines In this case I use a hybrid solution that provides the benefit of |
I've replaced I see now I forgot to answer your question:
Yes, all three ASP.NET projects use Microsoft.Extensions.DependencyInjection.ServiceProvider, and its services are added through the Thanks for pointing out the DNS behavior problem, I understand now what it is about. The Recommended use heading states:
Because we use short-lived If you think it's useful, I'd be happy to write some documentation pointing to this recommended use, as part of this PR. |
Thanks. The package needs to be added to the library itself for the netstandard target and not the test project as netfx consumers of the library will require the polyfill.
My comments have nothing to do with your own application code, this is specific to how I designed this library. I use long-lived injected httpclients due to the auth0 clients being singletons for perf reasons. I'm configuring
I don't feel this is necessary. I'll merge this in tomorrow and get a new release out. |
Thanks for your review and comments. I've moved the |
I've successfully used
Auth0Net.DependencyInjection
in a .NET 8.0 Blazor Web Application project to integrate with Auth0's Management API.I now need to do the same in three ASP.NET web applications running on .NET Framework 4.8. These can unfortunately not be migrated to .NET Core: their codebase is too large.
This pull request adds
netstandard2.0
as a target framework, and I've addednet48
to the test project's target frameworks to ensure test coverage for .NET Framework 4.8.Since System.Net.Http.SocketsHttpHandler is not supported in
netstandard2.0
, I've excluded it with a preprocessor directive, so the default implementation is used instead.@Hawxy could you please review and comment here if necessary?
Note: I updated the
Auth0Net.DependencyInjection
version to3.1.1
.