SimpleOAuth2Client.AspNetCore
1.0.0-beta
See the version list below for details.
dotnet add package SimpleOAuth2Client.AspNetCore --version 1.0.0-beta
NuGet\Install-Package SimpleOAuth2Client.AspNetCore -Version 1.0.0-beta
<PackageReference Include="SimpleOAuth2Client.AspNetCore" Version="1.0.0-beta" />
<PackageVersion Include="SimpleOAuth2Client.AspNetCore" Version="1.0.0-beta" />
<PackageReference Include="SimpleOAuth2Client.AspNetCore" />
paket add SimpleOAuth2Client.AspNetCore --version 1.0.0-beta
#r "nuget: SimpleOAuth2Client.AspNetCore, 1.0.0-beta"
#:package SimpleOAuth2Client.AspNetCore@1.0.0-beta
#addin nuget:?package=SimpleOAuth2Client.AspNetCore&version=1.0.0-beta&prerelease
#tool nuget:?package=SimpleOAuth2Client.AspNetCore&version=1.0.0-beta&prerelease
About SimpleOAuth2Client.AspNetCore
This repository provide a client for ASP.NET Core based projects that supports parts of the OAuth 2.0 Authorization Framework [RFC6749]
Important Information
At the moment only the authorization grant type "client credentials" is supported. Later the remaining ones are added.
NuGet
PM> Install-Package -Id SimpleOAuth2Client.AspNetCore -Version 1.0.0-alpha
How?
The SimpleOAuth2Client project defines a service interface named IOAuth2Client
to request access tokens from a OAuth2 based authorization server. The services is registred with lifetime "Signleton" and can be injected via the ASP.NET Core IoC-Container.
Usage
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
// Configure the SimpleOAuth2Client
builder.Services.AddSimpleOAuth2Client(options =>
{
options.ClientId = <ClientId>;
options.ClientSecret = <ClientSecret>;
options.TokenEndpoint = <TokenEndpoint>;
});
WebApplication app = builder.Build();
// Inject and use the IOAuth2Client as a service
app.MapGet("/test-access-token-request", async (IOAuth2Client client) =>
{
Result<AccessToken, OAuth2Error> result = await client.RequestAccessToken();
if (result.IsFailure)
{
return Results.BadRequest(result.Error);
}
return Results.Ok(result.Value);
});
app.Run();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- CSharpFunctionalExtensions (>= 2.37.0)
- FluentValidation (>= 11.5.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Hosting (>= 7.0.1)
- Microsoft.Extensions.Http (>= 7.0.0)
- Microsoft.Extensions.Http.Polly (>= 7.0.4)
- Polly.Contrib.WaitAndRetry (>= 1.1.1)
-
net7.0
- CSharpFunctionalExtensions (>= 2.37.0)
- FluentValidation (>= 11.5.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Hosting (>= 7.0.1)
- Microsoft.Extensions.Http (>= 7.0.0)
- Microsoft.Extensions.Http.Polly (>= 7.0.4)
- Polly.Contrib.WaitAndRetry (>= 1.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 259 | 4/12/2023 |
1.0.0-beta | 195 | 3/27/2023 |
1.0.0-alpha | 196 | 3/13/2023 |