diff --git a/src/Auth0Net.DependencyInjection/Auth0Extensions.cs b/src/Auth0Net.DependencyInjection/Auth0Extensions.cs
index 548825c..688f5b6 100644
--- a/src/Auth0Net.DependencyInjection/Auth0Extensions.cs
+++ b/src/Auth0Net.DependencyInjection/Auth0Extensions.cs
@@ -46,18 +46,18 @@ public static IHttpClientBuilder AddAuth0AuthenticationClientCore(this IServiceC
/// An that can be used to configure the .
public static IHttpClientBuilder AddAuth0AuthenticationClient(this IServiceCollection services, Action config)
{
- if(services.Any(x=> x.ServiceType == typeof(IAuthenticationApiClient)))
+ if (services.Any(x => x.ServiceType == typeof(IAuthenticationApiClient)))
throw new InvalidOperationException("AuthenticationApiClient has already been registered!");
services.AddOptions()
.Configure(config)
.Validate(x => !string.IsNullOrWhiteSpace(x.ClientId) && !string.IsNullOrWhiteSpace(x.Domain) && !string.IsNullOrWhiteSpace(x.ClientSecret),
"Auth0 Configuration cannot have empty values");
-
+
return services.AddAuth0AuthenticationClientInternal(true);
}
-
-
+
+
///
/// Adds a integrated with as well as the and related services to the .
///
@@ -69,14 +69,14 @@ public static IHttpClientBuilder AddAuth0AuthenticationClient(this IServiceColle
/// An that can be used to configure the .
public static IHttpClientBuilder AddAuth0AuthenticationClient(this IServiceCollection services, Action config)
{
- if(services.Any(x=> x.ServiceType == typeof(IAuthenticationApiClient)))
+ if (services.Any(x => x.ServiceType == typeof(IAuthenticationApiClient)))
throw new InvalidOperationException("AuthenticationApiClient has already been registered!");
services.AddOptions()
.Configure(config)
.Validate(x => !string.IsNullOrWhiteSpace(x.ClientId) && !string.IsNullOrWhiteSpace(x.Domain) && !string.IsNullOrWhiteSpace(x.ClientSecret),
"Auth0 Configuration cannot have empty values");
-
+
return services.AddAuth0AuthenticationClientInternal(true);
}
@@ -91,15 +91,17 @@ private static IHttpClientBuilder AddAuth0AuthenticationClientInternal(this ISer
services.AddSingleton();
return services.AddHttpClient()
- .ConfigurePrimaryHttpMessageHandler(() =>
+#if !NETSTANDARD2_0
+ .ConfigurePrimaryHttpMessageHandler(() =>
new SocketsHttpHandler()
{
PooledConnectionLifetime = TimeSpan.FromMinutes(2)
})
+#endif
.SetHandlerLifetime(Timeout.InfiniteTimeSpan);
}
-
-
+
+
///
/// Adds a integrated with to the .
@@ -114,11 +116,13 @@ public static IHttpClientBuilder AddAuth0ManagementClient(this IServiceCollectio
services.AddSingleton();
return services.AddHttpClient()
- .ConfigurePrimaryHttpMessageHandler(() =>
+#if !NETSTANDARD2_0
+ .ConfigurePrimaryHttpMessageHandler(() =>
new SocketsHttpHandler()
{
PooledConnectionLifetime = TimeSpan.FromMinutes(2)
})
+#endif
.SetHandlerLifetime(Timeout.InfiniteTimeSpan);
}
@@ -136,7 +140,7 @@ public static IHttpClientBuilder AddAccessToken(this IHttpClientBuilder builder,
if (c.AudienceResolver is null && string.IsNullOrWhiteSpace(c.Audience))
throw new ArgumentException("Audience or AudienceResolver must be set");
- return builder.AddHttpMessageHandler(provider =>
+ return builder.AddHttpMessageHandler(provider =>
new Auth0TokenHandler(provider.GetRequiredService(), c));
}
diff --git a/src/Auth0Net.DependencyInjection/Auth0Net.DependencyInjection.csproj b/src/Auth0Net.DependencyInjection/Auth0Net.DependencyInjection.csproj
index 007869f..4f68017 100644
--- a/src/Auth0Net.DependencyInjection/Auth0Net.DependencyInjection.csproj
+++ b/src/Auth0Net.DependencyInjection/Auth0Net.DependencyInjection.csproj
@@ -1,13 +1,14 @@
- net6.0;net7.0;net8.0
+ netstandard2.0;net6.0;net7.0;net8.0
true
enable
enable
- 3.1.0
+ 3.1.1
Hawxy
Dependency Injection, HttpClientFactory & ASP.NET Core extensions for Auth0.NET
+ latest
true
Hawxy 2020-2023
icon.png
@@ -26,6 +27,13 @@
+
+
+
+
+
+
+
diff --git a/tests/Auth0Net.DependencyInjection.Tests/Auth0Net.DependencyInjection.Tests.csproj b/tests/Auth0Net.DependencyInjection.Tests/Auth0Net.DependencyInjection.Tests.csproj
index 9a64cf3..bc11fa1 100644
--- a/tests/Auth0Net.DependencyInjection.Tests/Auth0Net.DependencyInjection.Tests.csproj
+++ b/tests/Auth0Net.DependencyInjection.Tests/Auth0Net.DependencyInjection.Tests.csproj
@@ -1,8 +1,9 @@
- net6.0;net7.0;net8.0
false
+ net48;net6.0;net7.0;net8.0
+ latest