Netified.LicenseManager.Api.Client 1.3.0

dotnet add package Netified.LicenseManager.Api.Client --version 1.3.0
NuGet\Install-Package Netified.LicenseManager.Api.Client -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Netified.LicenseManager.Api.Client" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Netified.LicenseManager.Api.Client --version 1.3.0
#r "nuget: Netified.LicenseManager.Api.Client, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Netified.LicenseManager.Api.Client as a Cake Addin
#addin nuget:?package=Netified.LicenseManager.Api.Client&version=1.3.0

// Install Netified.LicenseManager.Api.Client as a Cake Tool
#tool nuget:?package=Netified.LicenseManager.Api.Client&version=1.3.0

Netified.LicenseManager.Api.Client

GitHub GitHub Sponsors GitHub Workflow Status Nuget Nuget

A .NET Standard and .NET Core License Manager REST API toolkit and API wrapper.

Installation

The library is available as a nuget package. You can install it as any other nuget package from your IDE, try to search by Netified.LicenseManager.Api.Client. You can find package details on this web page.

// Package Manager
Install-Package Netified.LicenseManager.Api.Client

// .NET CLI
dotnet add package Netified.LicenseManager.Api.Client

// Package reference in .csproj file
<PackageReference Include="Netified.LicenseManager.Api.Client" Version="1.0.0" />

Then add the following to your ConfigureServices method.

services.AddLicenseManagerClient<MyAPIHandler>(Configuration)

The following are required in app settings if you are not using an official installation:

"ApiClientConfiguration":{
    "BaseAddress": "https://api.netified.io/license-manager/v1/"
}

Configuration

By default API requests to License Manager must be authenticated, you can find below an handler to add authentication on your API requests.

public class MyAPIHandler : DelegatingHandler
{
    private readonly IHttpContextAccessor _httpContextAccessor;
    private readonly ILogger<MyAPIHandler> _logger;

    /// <summary>
    /// Initializes a new instance of the <see cref="MyAPIHandler"/> class.
    /// </summary>
    /// <param name="httpContextAccessor">The HTTP context accessor.</param>
    /// <param name="logger">The logger.</param>
    public MyAPIHandler(IHttpContextAccessor httpContextAccessor, ILogger<MyAPIHandler> logger)
    {
        _httpContextAccessor = httpContextAccessor;
        _logger = logger;
    }

    /// <summary>
    /// Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
    /// </summary>
    /// <param name="request">The HTTP request message to send to the server.</param>
    /// <param name="cancellationToken">A cancellation token to cancel operation.</param>
    /// <returns>
    /// The task object representing the asynchronous operation.
    /// </returns>
    protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        HttpResponseMessage responseMessage;
        try
        {
            var accessToken = await _httpContextAccessor.HttpContext!.GetTokenAsync("access_token");
            if (string.IsNullOrEmpty(accessToken))
                throw new Exception($"Access token is missing for the request {request.RequestUri}");

            request.Headers.Authorization = new AuthenticationHeaderValue("bearer", accessToken);

            responseMessage = await base.SendAsync(request, cancellationToken);
            responseMessage.EnsureSuccessStatusCode();
        }
        catch (Exception ex)
        {
            _logger.LogError(ex, "Failed to run http query {RequestUri}", request.RequestUri);
            throw;
        }
        return responseMessage;
    }
}

Please show the value

Choosing a project dependency could be difficult. We need to ensure stability and maintainability of our projects. Surveys show that GitHub stars count play an important factor when assessing library quality.

⭐ Please give this repository a star. It takes seconds and help thousands of developers! ⭐

Support development

It doesn't matter if you are a professional developer, creating a startup or work for an established company. All of us care about our tools and dependencies, about stability and security, about time and money we can safe, about quality we can offer. Please consider sponsoring to give me an extra motivational push to develop the next great feature.

If you represent a company, want to help the entire community and show that you care, please consider sponsoring using one of the higher tiers. Your company logo will be shown here for all developers, building a strong positive relation.

How to Contribute

Everyone is welcome to contribute to this project! Feel free to contribute with pull requests, bug reports or enhancement suggestions.

Bugs and Feedback

For bugs, questions and discussions please use the GitHub Issues.

License

This project is licensed under MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3.0 403 8/23/2022
1.2.8 393 8/23/2022
1.2.7 373 8/21/2022
1.2.6 344 8/21/2022
1.2.5 359 8/21/2022
1.2.4 381 8/20/2022
1.2.3 376 8/20/2022
1.2.2 351 8/18/2022
1.2.1 361 8/16/2022
1.2.0 361 8/16/2022
1.1.1 372 7/31/2022
1.1.0 373 7/31/2022
1.0.0 395 7/30/2022