Skip to content

Commit

Permalink
v1.4.0 (#6)
Browse files Browse the repository at this point in the history
* Update README.md

* Updates
  • Loading branch information
Hawxy authored Apr 3, 2021
1 parent 5c66722 commit 54d60d7
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 17 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Auth0.NET Dependency Injection Extensions
![.NET Core Build & Test](https://github.com/Hawxy/Auth0Net.DependencyInjection/workflows/.NET%20Core%20Build%20&%20Test/badge.svg)
[![NuGet](https://img.shields.io/nuget/v/Auth0Net.DependencyInjection.svg?style=flat-square)](https://www.nuget.org/packages/Auth0Net.DependencyInjection)
[![deepcode](https://www.deepcode.ai/api/gh/badge?key=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwbGF0Zm9ybTEiOiJnaCIsIm93bmVyMSI6Ikhhd3h5IiwicmVwbzEiOiJBdXRoME5ldC5EZXBlbmRlbmN5SW5qZWN0aW9uIiwiaW5jbHVkZUxpbnQiOmZhbHNlLCJhdXRob3JJZCI6MjczMDcsImlhdCI6MTYxNjczOTcyNH0.4StSyQGHntE1YwSsXjjvRtfJJRSvyUNn43YWT1_FHkU)](https://www.deepcode.ai/app/gh/Hawxy/Auth0Net.DependencyInjection/_/dashboard?utm_content=gh%2FHawxy%2FAuth0Net.DependencyInjection)

<h1 align="center">
<img align="center" src="src/Auth0Net.DependencyInjection/Images/icon.png" height="130px" />
Expand Down Expand Up @@ -77,6 +78,20 @@ services.AddAuth0ManagementClient().AddManagementAccessToken();

Ensure your Machine-to-Machine application is authorized to request tokens from the Managment API and it has the correct scopes for the features you wish to use.

You can then request the `ManagementApiClient` (or `IAuthenticationApiClient`) within your services:

```csharp

public class MyAuth0Service : IAuth0Service
{
private readonly ManagementApiClient _managementApiClient;

public AuthController(ManagementApiClient managementApiClient)
{
_managementApiClient = managementApiClient;
}
```

### With HttpClient and/or Grpc Services

![Auth0 All](docs/images/Auth0All.png?raw=true)
Expand Down
4 changes: 2 additions & 2 deletions samples/Sample.AspNetCore/Sample.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.33.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.36.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions samples/Sample.ConsoleApp/Sample.ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.14.0" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.33.1" />
<PackageReference Include="Grpc.Tools" Version="2.33.1">
<PackageReference Include="Google.Protobuf" Version="3.15.7" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.36.0" />
<PackageReference Include="Grpc.Tools" Version="2.36.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>enable</Nullable>
<Version>1.3.0</Version>
Expand All @@ -18,10 +18,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Auth0.AuthenticationApi" Version="7.3.2" />
<PackageReference Include="Auth0.ManagementApi" Version="7.3.2" />
<PackageReference Include="LazyCache.AspNetCore" Version="2.1.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Auth0.AuthenticationApi" Version="7.8.0" />
<PackageReference Include="Auth0.ManagementApi" Version="7.8.0" />
<PackageReference Include="LazyCache.AspNetCore" Version="2.1.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
Expand All @@ -30,7 +30,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
Expand All @@ -43,7 +43,7 @@
</ItemGroup>

<ItemGroup>
<None Include="Images\icon.png" Pack="True" PackagePath=""/>
<None Include="Images\icon.png" Pack="True" PackagePath="" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Auth0Net.DependencyInjection/Cache/Auth0TokenCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Auth0TokenCache : IAuth0TokenCache
private readonly Auth0Configuration _config;

/// <summary>
/// An implementation of <see cref="IAuth0TokenCache"/> that caches Auth0 Access Tokens until 5 minutes before expiry
/// An implementation of <see cref="IAuth0TokenCache"/> that caches and renews Auth0 Access Tokens
/// </summary>
/// <param name="client">The Authentication Client</param>
/// <param name="cache">An application cache from LazyCache </param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Auth0TokenHandlerConfig
public Auth0TokenHandlerConfig() { }

/// <summary>
/// Initializes a new instance of <see cref="Auth0TokenHandlerConfig"/> with no Audience set.
/// Initializes a new instance of <see cref="Auth0TokenHandlerConfig"/>.
/// </summary>
public Auth0TokenHandlerConfig(string audience)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="6.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="FakeItEasy" Version="7.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="3.0.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 54d60d7

Please sign in to comment.