Tenduke.Client
4.0.2
dotnet add package Tenduke.Client --version 4.0.2
NuGet\Install-Package Tenduke.Client -Version 4.0.2
<PackageReference Include="Tenduke.Client" Version="4.0.2" />
paket add Tenduke.Client --version 4.0.2
#r "nuget: Tenduke.Client, 4.0.2"
// Install Tenduke.Client as a Cake Addin #addin nuget:?package=Tenduke.Client&version=4.0.2 // Install Tenduke.Client as a Cake Tool #tool nuget:?package=Tenduke.Client&version=4.0.2
Client library for 10Duke Identity and Entitlement
This is the base client library, other platform specific client libraries are built on this one. See the repository README for client library listing.
This base client library can also be used directly, instead of the more specific client libraries derived from this one. The main cases for using this base client library are:
- The application using the client library implements OAuth 2.0 authorization flow by itself, thus not needing a library that implements the OAuth flow
- A specific client library for the desired platform is not available
Main features of this base client library are:
- Querying user info
- Checking and consuming licenses
- Checking end-user permissions
- Releasing consumed licenses
Installation
The client library is available as a NuGet package. An example for installing the client library using NuGet Package Manager:
Installation with dotnet cli
dotnet add package Tenduke.Client
Installation with NuGet PackageManager
Install-Package Tenduke.Client
Basic usage
Class Tenduke.Client.EntClient
is the main implementation class that provides access to the APIs. Configuration and features of Tenduke.Client.WinForms.EntClient
are introduced below.
Authentication and authorization
User authentication is outside the scope of this client implementation. For being able to call the APIs, an OAuth access token must be used.
EntClient initialization
An instance of EntClient can be created like this:
var entClient = new EntClient()
{
OAuthConfig = myOAuthConfig,
AuthzApiConfig = myAuthzApiConfig,
AccessToken = myAccessToken
};
Here, +myOAuthConfig+ is an instance of +Tenduke.Client.Config.OAuthConfig+, for instance:
var myOAuthConfig = new OAuthConfig()
{
UserInfoUri = "https://my-test-idp.10duke.net/userinfo/"
};
Here, it is sufficient to initialize only the +UserInfoUri+, and this Uri must point to an actual 10Duke Entitlement service deployment.
myAuthzApiConfig
is an instance of Tenduke.Client.Config.AuthzApiConfig
, for instance:
var myAuthzApiConfig = new AuthzApiConfig()
{
EndpointUri = "https://my-test-idp.10duke.net/authz/",
SignerKey = [Public key of 10Duke Entitlement service]
};
EndpointUri
points to the authorization endpoint of the actual deployment. SignerKey
is the RSA public key that is used for verifying signatures of tokens issued by the 10Duke Entitlement service. The following utility is provided for reading an RSA key from string:
var publicKey = Tenduke.Client.Util.CryptoUtil.ReadRsaPublicKey(publicKeyAsString);
And finally, myAccessToken
is the access token that, acquired by completing an OAuth flow. Now, the EntClient
instance is ready to be used.
Using the client to make 10Duke API calls
Example user info and license requests are given below:
User info request
var userInfo = await entClient.UserInfoApi.GetUserInfoAsync();
This call returns an object with OpenID Connect user info.
Consume license
var tokenResponse = await entClient.AuthzApi.CheckOrConsumeAsync("MyLicense", true, ResponseType.JWT);
This call returns a Tenduke.Client.EntApi.Authz.AuthorizationDecision
object that describes an authorization decision, returned as a signed JWT token. The AuthorizationDecision
indicates if a license lease has been granted (and a license seat has been taken), and the client application can rely on the AuthorizationDecision
until the object expires. Expiration of the object is the same as expiration of the returned JWT token and expiration of the license lease.
Release license
var releaseResponse = await entClient.AuthzApi.ReleaseLicenseAsync(tokenResponse["jti"], ResponseType.JWT);
This call is used for returning a consumed lease (license seat) back to the license pool.
Links
Product | Versions 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 is compatible. 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. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.1.2)
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http.Json (>= 8.0.1)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.1.2)
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http.Json (>= 8.0.1)
- System.Text.Json (>= 8.0.5)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Tenduke.Client:
Package | Downloads |
---|---|
Tenduke.Client.Desktop
Base classes and utilities for 10Duke Identity and Entitlement client libraries for .Net desktop applications |
|
Tenduke.Client.AspNetCore
ASP.NET client library for 10Duke Identity and Entitlement |
|
Tenduke.Client.WPF
Package Description |
|
Tenduke.Client.WinForms
Package Description |
|
Tenduke.Client.WinBase
Base library for Windows based 10Duke Identity and Entitlement client libraries |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.0.2 | 193 | 10/29/2024 |
4.0.1 | 236 | 7/16/2024 |
4.0.0 | 349 | 3/11/2024 |
3.6.0 | 349 | 9/20/2023 |
3.4.3 | 3,296 | 6/10/2022 |
3.4.2 | 2,590 | 2/14/2022 |
3.4.0 | 2,245 | 2/11/2022 |
3.3.1 | 1,415 | 1/3/2022 |
3.3.0 | 296 | 1/3/2022 |
3.2.0 | 5,403 | 3/10/2021 |
3.1.1 | 1,004 | 11/30/2020 |
3.1.0 | 1,589 | 10/30/2020 |
3.0.0 | 1,961 | 4/2/2020 |
2.3.4 | 1,676 | 3/16/2020 |
2.3.3 | 1,595 | 3/12/2020 |
2.3.2 | 1,195 | 12/9/2019 |
2.3.1 | 1,988 | 12/5/2019 |
2.3.0 | 1,699 | 4/1/2019 |
2.2.2 | 1,675 | 3/19/2019 |
2.2.1 | 1,654 | 3/19/2019 |
2.2.0 | 1,685 | 2/14/2019 |
2.1.0 | 1,750 | 1/25/2019 |
2.0.4 | 907 | 1/24/2019 |
2.0.3 | 1,800 | 1/21/2019 |
2.0.2 | 1,433 | 12/4/2018 |
2.0.1 | 1,926 | 6/26/2018 |
2.0.0 | 2,342 | 5/30/2018 |
1.0.2 | 1,603 | 5/11/2018 |
1.0.1 | 1,412 | 5/9/2018 |