didx.aries-cloudapi-dotnet-aspcore 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package didx.aries-cloudapi-dotnet-aspcore --version 1.1.1                
NuGet\Install-Package didx.aries-cloudapi-dotnet-aspcore -Version 1.1.1                
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="didx.aries-cloudapi-dotnet-aspcore" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add didx.aries-cloudapi-dotnet-aspcore --version 1.1.1                
#r "nuget: didx.aries-cloudapi-dotnet-aspcore, 1.1.1"                
#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 didx.aries-cloudapi-dotnet-aspcore as a Cake Addin
#addin nuget:?package=didx.aries-cloudapi-dotnet-aspcore&version=1.1.1

// Install didx.aries-cloudapi-dotnet-aspcore as a Cake Tool
#tool nuget:?package=didx.aries-cloudapi-dotnet-aspcore&version=1.1.1                

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)

alt text

Out-of-band (OOB)

alt text

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",
    "GroupId": "your assigned aries cloud group id",
  }
}

For production/remote installations, the OAuth settings are required for either the Customer or GovernanceAdmin roles (see clients below).

"AriesCloudAPI": {
    "BaseUri": "http://localhost:8000",
    "GroupId": "your assigned aries cloud group id",
    "GovernanceAdmin": {
      "ClientId": "{OAuthClientId}",
      "ClientSecret": "{OAuthClientSecret}"
    },
    "Customer": {
      "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.

  • GroupId is your assigned groupId in Aries Cloud API and is used for multi-tenancy segregation. This would be supplied to you for remote installations. Required.

  • Customer and/or GovernanceAdmin - the OAuth settings for the Customer 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 v1.

  • 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.

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.

  • CreateCustomerClient()

    Creates a client under the context of the 'tenant-admin' role as defined in Aries Cloud API. See ICustomerClient.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.

  • CreateCustomerWebSocketClient(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.

  • CreateCustomerSSEClientSingleEvent(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.

  • CreateCustomerSSEClientStream(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.GetCredentialsAsync();

            return credentials?.Select(x => x.ToString());
        }
    }

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 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. 
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 130 11/12/2024
1.2.9 87 11/11/2024
1.2.8 574 9/5/2024
1.2.7 242 8/27/2024
1.2.6 189 8/22/2024
1.2.5 592 7/17/2024
1.2.4 471 6/25/2024
1.2.3 106 6/25/2024
1.2.2 2,018 3/24/2024
1.2.1 103 3/24/2024
1.2.0 113 3/24/2024
1.1.9 294 3/19/2024
1.1.8 311 3/12/2024
1.1.7 871 2/12/2024
1.1.6 120 2/8/2024
1.1.5 146 2/8/2024
1.1.4 107 2/8/2024
1.1.3 188 2/7/2024
1.1.2 1,168 11/13/2023
1.1.1 157 11/13/2023
1.1.0 319 11/7/2023
1.0.9 218 11/2/2023
1.0.8 202 10/16/2023
1.0.7 161 10/16/2023
1.0.6 161 10/11/2023
1.0.5 144 10/11/2023
1.0.4 381 9/28/2023
1.0.3 128 9/21/2023
1.0.2 118 9/21/2023
1.0.1 236 9/20/2023
1.0.0 132 9/20/2023

Aries Cloud API Intial Release