AffinidiTdk.IamClient 1.1.0

dotnet add package AffinidiTdk.IamClient --version 1.1.0
                    
NuGet\Install-Package AffinidiTdk.IamClient -Version 1.1.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="AffinidiTdk.IamClient" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AffinidiTdk.IamClient" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AffinidiTdk.IamClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AffinidiTdk.IamClient --version 1.1.0
                    
#r "nuget: AffinidiTdk.IamClient, 1.1.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.
#:package AffinidiTdk.IamClient@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AffinidiTdk.IamClient&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AffinidiTdk.IamClient&version=1.1.0
                    
Install as a Cake Tool

<a id="top"></a>

Affinidi TDK .NET client for Iam

Affinidi TDK dotnet client for Affinidi IAM

Getting Started

Prerequisites

Check your installed version:

dotnet --version

Installation

These are the steps to get you started with a dotnet project and integration with AffinidiTdk.IamClient. Note: Steps 1 & 2 are optional if you have already created a project.

  1. Create a new project directory

*On macOS / Linux / Windows (Powershell) 😗

mkdir MyProject
cd MyProject
  1. Initialize a .NET Project (dotnet template: console)
dotnet new console
  1. Installing the TDK Client (from nuget.org)
dotnet add package AffinidiTdk.IamClient

<p align="right">(<a href="#top">back to top</a>)</p>

Usage

  1. Import the required dependencies

The dependencies required may differ based on the Client Api used in your application.

using AffinidiTdk.AuthProvider;
using AffinidiTdk.IamClient.Api;
using AffinidiTdk.IamClient.Client;
using AffinidiTdk.IamClient.Model;
  1. Create an AuthProvider
  • The AuthProvider is a separate package which you will need to install. Get it from nuget.org. NOTE: This step requires you to first create your Personal Access Token (PAT). Please refer to this link
var authProvider = new AuthProvider(new AuthProviderParams
{
    // Please generate your own Personal Access Tokens (PAT). 
    // Refer to https://docs.affinidi.com/dev-tools/affinidi-tdk/get-access-token/#create-a-personal-access-token-pat for the guide on creating your own PAT.    
    TokenId = "YOUR_TOKEN_ID",
    PrivateKey = "YOUR_PRIVATE_KEY",
    ProjectId = "YOUR_PROJECT_ID"
    // Passphrase = "YOUR_PASSPHRASE", // Required only if provided in the PAT
});
  1. Fetch the ProjectScopedToken from the AuthProvider
string projectScopedToken = await authProvider.FetchProjectScopedTokenAsync();
  1. Create an instance of the Client Configuration
  • In this step, you can set the projectScopedToken in the configuration.

Configuration config = new Configuration();

config.AddApiKey("authorization", projectScopedToken);

  1. Create an instance of the Client Api you intend to use
  • In this step, you should pass the config as a constructor argument in the Client Api. NOTE: Each Operation requires different input. Please refer to the <a href="#documentation">operation documentation</a> for the details.


AuthzApi api = new AuthzApi(config);

var granteeDid = "granteeDid_example";

api.DeleteAccessVfs(granteeDid);



For more examples, please refer to the Documentation.

Token Refresh

When handling tokens, it is important that your project access token is managed properly to prevent failures due to expired tokens.

We have created an example code which handles the automatic refresh of tokens to ensure that the token used in the client APIs are fresh.

<p align="right">(<a href="#top">back to top</a>)</p>

Documentation

Client Api Documentation

ClientApi Operation Description
AuthzApi DeleteAccessVfs delete access of granteeDid
AuthzApi GrantAccessVfs Grant access to the virtual file system
AuthzApi UpdateAccessVfs Update access of granteeDid
ConsumerAuthApi ConsumerAuthTokenEndpoint The Consumer OAuth 2.0 Token Endpoint
DefaultApi V1AuthProxyDelete
DefaultApi V1AuthProxyGet
DefaultApi V1AuthProxyPatch
DefaultApi V1AuthProxyPost
DefaultApi V1AuthProxyPut
DefaultApi V1IdpProxyDelete
DefaultApi V1IdpProxyGet
DefaultApi V1IdpProxyPatch
DefaultApi V1IdpProxyPost
DefaultApi V1IdpProxyPut
PoliciesApi GetPolicies
PoliciesApi UpdatePolicies
ProjectsApi AddPrincipalToProject
ProjectsApi CreateProject
ProjectsApi DeletePrincipalFromProject
ProjectsApi ListPrincipalsOfProject
ProjectsApi ListProject
ProjectsApi UpdateProject
StsApi CreateProjectScopedToken
StsApi Whoami
TokensApi CreateToken
TokensApi DeleteToken
TokensApi GetToken
TokensApi ListProjectsOfToken
TokensApi ListToken
TokensApi UpdateToken
WellKnownApi GetWellKnownDid
WellKnownApi GetWellKnownJwks

Note: Each Client API operation requires a different authorization token. Please check the operation details for the type of token required to use the operation properly.

Documentation For Models

<p align="right">(<a href="#top">back to top</a>)</p>

Support & Feedback

If you face any issues or have suggestions, please don't hesitate to contact us using this link.

Reporting technical issues

If you have a technical issue with the Affinidi TDK's codebase, you can also create an issue directly in GitHub.

  1. Ensure the bug was not already reported by searching on GitHub under Issues.

  2. If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

<p align="right">(<a href="#top">back to top</a>)</p>

Contributing

We enjoy community contributions! Whether it’s bug fixes, feature requests, or improving docs, your input helps shape the Affinidi TDK.

<p align="right">(<a href="#top">back to top</a>)</p>

Product Compatible and additional computed target framework versions.
.NET 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.  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. 
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.1.0 164 10/2/2025

Minor update