didx.aries-cloudapi-dotnet-aspcore
1.2.4
See the version list below for details.
dotnet add package didx.aries-cloudapi-dotnet-aspcore --version 1.2.4
NuGet\Install-Package didx.aries-cloudapi-dotnet-aspcore -Version 1.2.4
<PackageReference Include="didx.aries-cloudapi-dotnet-aspcore" Version="1.2.4" />
paket add didx.aries-cloudapi-dotnet-aspcore --version 1.2.4
#r "nuget: didx.aries-cloudapi-dotnet-aspcore, 1.2.4"
// Install didx.aries-cloudapi-dotnet-aspcore as a Cake Addin #addin nuget:?package=didx.aries-cloudapi-dotnet-aspcore&version=1.2.4 // Install didx.aries-cloudapi-dotnet-aspcore as a Cake Tool #tool nuget:?package=didx.aries-cloudapi-dotnet-aspcore&version=1.2.4
didx-aries-cloudapi-dotnet
This repository contains the core functionality needed to implement Self-Sovereign Identity (SSI) flows in .NET applications using the DIDx Aries Cloud API.
SSI Flows
See the DIDx Aries Cloud API Documentation for more information on the SSI flows.
The following SSI flows are supported by the .NET SDK:
Connection Invitations (CI)
Out-of-band (OOB)
Install
Package source
nuget.org (https://api.nuget.org/v3/index.json)
Install package
Install-Package didx.aries-cloudapi-dotnet-aspcore
Configuration
Add the following configuration to your appsettings.json
This is the minimal configuration for a localhost installation:
{
...
"AriesCloudAPI": {
"BaseUri": "http://localhost:8000"
}
}
For production/remote installations, the OAuth settings are required for either the TenantAdmin
or GovernanceAdmin
roles (see clients below).
"AriesCloudAPI": {
"BaseUri": "http://localhost:8000",
"OrganizationId": "your assigned aries cloud organization id",
"GovernanceAdmin": {
"ClientId": "{OAuthClientId}",
"ClientSecret": "{OAuthClientSecret}"
},
"TenantAdmin": {
"ClientId": "{OAuthClientId}",
"ClientSecret": "{OAuthClientSecret}"
}
}
Here are the available options:
BaseUri
is the url of the Aries Cloud API. This can be localhost or a remote installation. Required.OrganizationId
is your assigned organizationId in Aries Cloud API and is used for multi-tenancy segregation. This would be supplied to you for remote installations. Optional for localhost.TenantAdmin
and/orGovernanceAdmin
- the OAuth settings for the TenantAdmin and/or GovernanceAdmin roles as defined in Aries Cloud API. Optional for localhost. Required for production/remote urls.{OAuthClientId}
&{OAuthClientSecret}
are the OAuth configuration. This would be supplied to you for remote installation.ProtocolVersion
the hand-shake protocol to use i.e. v1 or v2. Default is v2.SSETimeoutInSeconds
SSE connection timeout in seconds. Default is 120.DebugOutput
is a boolean value that determines whether the SDK will output debug information to the console. This is useful for debugging purposes. Optional. Not recommended for production environments.EnableTenantTokenCaching
indicates whether tenant tokens should be cached. When set to true, tokens obtained for tenants will be stored in cache and automatically rotated based on the specified rotation interval. This option helps in managing the lifecycle of tenant tokens efficiently, reducing the need for frequent token requests.TenantTokenCacheRotationIntervalDays
Defines the interval, in days, after which tenant tokens should be rotated (i.e., refreshed). This setting is applicable only if tenant token caching is enabled. It specifies how often the tokens are renewed in the cache, ensuring that tokens remain valid and secure.
Startup
Add the following to your application startup (Startup.cs):
public void ConfigureServices(IServiceCollection services)
{
...
services.AddAriesCloudAPI();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
app.ApplicationServices.UseAriesCloudAPI();
}
Usage
To use the Aries Cloud API, a client-proxy must first be created via the ClientFactory
class.
This is supplied by the Dependency Injection in .NET and provides the following methods to create clients for the respective contexts:
CreatePublicClient()
Creates a client for anonymous or public access to the Trust Registry. See IPublicClient.cs for available operations.
CreateGovernanceClient()
Creates a client under the context of the 'governance' role as defined in Aries Cloud API. See IGovernanceClient.cs for available operations.
CreateTenantAdminClient()
Creates a client under the context of the 'tenant-admin' role as defined in Aries Cloud API. See ITenantAdminClient.cs for available operations.
CreateTenantClient(string tenantId)
Creates a client under the context of the 'tenant' role as defined in Aries Cloud API. An access-token will automatically be obtained for the specified tenantId. See ITenantClient.cs for available operations.
CreateTenantClientWithAccessToken(string access_token)
Creates a client under the context of the 'tenant' role as defined in Aries Cloud API. The specified access-token will be used to authenticate the client. See ITenantClient.cs for available operations.
CreateTenantAdminWebSocketClient(Topic[] topics, string? tenantId, CancellationToken cancellationToken)
Creates an open websocket client under the context of the 'tenant-admin' role as defined in Aries Cloud API. It automatically issues the subscribe request and returns a connected client ready for use. See ClientWebSocket for more info.
CreateTenantAdminSSEClientSingleEvent(string tenantId, Topic topic, string desiredState, string? fieldName = null, string? fieldValue = null)
Returns an open Stream to receive Server-Side Events (SSE). The stream will close after the first event is received.
CreateTenantAdminSSEClientStream(string tenantId, Topic? topic = null, string? fieldName = null, string? fieldValue = null)
Returns an open Stream to receive Server-Side Events (SSE). The stream will remain open for the duration of the connection.
Example:
public class ValuesController : ControllerBase
{
private ClientFactory _clientFactory;
public ValuesController(ClientFactory clientFactory)
{
_clientFactory = clientFactory;
}
[HttpGet]
public async Task<IEnumerable<string>> GetAsync()
{
// create client
var client = _clientFactory.CreateGovernanceClient();
// example usage
var credentials = await client.GetIndyCredentialsAsync();
return credentials?.Select(x => x.ToString());
}
}
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 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | 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.1
- Flurl.Http (>= 4.0.2)
- Flurl.Http.Newtonsoft (>= 0.9.1)
- Microsoft.Extensions.Caching.Memory (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.ComponentModel.Annotations (>= 5.0.0)
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 | 184 | 11/12/2024 |
1.2.9 | 90 | 11/11/2024 |
1.2.8 | 576 | 9/5/2024 |
1.2.7 | 244 | 8/27/2024 |
1.2.6 | 191 | 8/22/2024 |
1.2.5 | 596 | 7/17/2024 |
1.2.4 | 473 | 6/25/2024 |
1.2.3 | 108 | 6/25/2024 |
1.2.2 | 2,022 | 3/24/2024 |
1.2.1 | 105 | 3/24/2024 |
1.2.0 | 115 | 3/24/2024 |
1.1.9 | 296 | 3/19/2024 |
1.1.8 | 313 | 3/12/2024 |
1.1.7 | 873 | 2/12/2024 |
1.1.6 | 122 | 2/8/2024 |
1.1.5 | 148 | 2/8/2024 |
1.1.4 | 109 | 2/8/2024 |
1.1.3 | 190 | 2/7/2024 |
1.1.2 | 1,170 | 11/13/2023 |
1.1.1 | 159 | 11/13/2023 |
1.1.0 | 321 | 11/7/2023 |
1.0.9 | 220 | 11/2/2023 |
1.0.8 | 204 | 10/16/2023 |
1.0.7 | 163 | 10/16/2023 |
1.0.6 | 165 | 10/11/2023 |
1.0.5 | 146 | 10/11/2023 |
1.0.4 | 383 | 9/28/2023 |
1.0.3 | 132 | 9/21/2023 |
1.0.2 | 120 | 9/21/2023 |
1.0.1 | 238 | 9/20/2023 |
1.0.0 | 134 | 9/20/2023 |
Aries Cloud API Intial Release