AffinidiTdk.IamClient
1.1.0
dotnet add package AffinidiTdk.IamClient --version 1.1.0
NuGet\Install-Package AffinidiTdk.IamClient -Version 1.1.0
<PackageReference Include="AffinidiTdk.IamClient" Version="1.1.0" />
<PackageVersion Include="AffinidiTdk.IamClient" Version="1.1.0" />
<PackageReference Include="AffinidiTdk.IamClient" />
paket add AffinidiTdk.IamClient --version 1.1.0
#r "nuget: AffinidiTdk.IamClient, 1.1.0"
#:package AffinidiTdk.IamClient@1.1.0
#addin nuget:?package=AffinidiTdk.IamClient&version=1.1.0
#tool nuget:?package=AffinidiTdk.IamClient&version=1.1.0
<a id="top"></a>
Affinidi TDK .NET client for Iam
Affinidi TDK dotnet client for Affinidi IAM
Getting Started
Prerequisites
- .NET 8 SDK (minimum version: 8.0.400)
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.
- Create a new project directory
*On macOS / Linux / Windows (Powershell) 😗
mkdir MyProject
cd MyProject
- Initialize a .NET Project (dotnet template: console)
dotnet new console
- Installing the TDK Client (from nuget.org)
dotnet add package AffinidiTdk.IamClient
<p align="right">(<a href="#top">back to top</a>)</p>
Usage
- 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;
- 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
});
- Fetch the ProjectScopedToken from the AuthProvider
string projectScopedToken = await authProvider.FetchProjectScopedTokenAsync();
- 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);
- 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
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
- ActionForbiddenError
- AddUserToProjectInput
- ConsumerAuthTokenEndpointInput
- ConsumerAuthTokenEndpointOutput
- CorsConsumerAuthTokenEndpointOK
- CorsGrantAccessVfsOK
- CorsUpdateAccessVfsOK
- CreateProjectInput
- CreateProjectScopedTokenInput
- CreateProjectScopedTokenOutput
- CreateTokenInput
- DeleteAccessOutput
- GrantAccessInput
- GrantAccessOutput
- InvalidDIDError
- InvalidJwtTokenError
- InvalidParameterError
- JsonWebKeyDto
- JsonWebKeySetDto
- NotFoundError
- PolicyDto
- PolicyStatementDto
- PrincipalCannotBeDeletedError
- PrincipalDoesNotBelongToProjectError
- ProjectDto
- ProjectList
- ProjectWithPolicyDto
- ProjectWithPolicyList
- PublicKeyCannotBeResolvedFromDidError
- RightsEnum
- ServiceErrorResponse
- ServiceErrorResponseDetailsInner
- TokenDto
- TokenList
- TokenPrivateKeyAuthenticationMethodDto
- TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfo
- TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfoOneOf
- TokenPrivateKeyAuthenticationMethodDtoPublicKeyInfoOneOf1
- TypedPrincipalId
- UnauthorizedError
- UnexpectedError
- UpdateAccessInput
- UpdateAccessOutput
- UpdateProjectInput
- UpdateTokenInput
- UpdateTokenPrivateKeyAuthenticationMethodDto
- UserDto
- UserList
- WhoamiDto
<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.
Ensure the bug was not already reported by searching on GitHub under Issues.
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.
- Head over to our CONTRIBUTING to get started.
- Have an idea? Start a discussion in GitHub Discussions or Discord
<p align="right">(<a href="#top">back to top</a>)</p>
| Product | Versions 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. |
-
net8.0
- JsonSubTypes (>= 2.0.1)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.1.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.1.0 | 164 | 10/2/2025 |
Minor update