Altinn.ApiClients.Dialogporten
1.57.2-rc
See the version list below for details.
dotnet add package Altinn.ApiClients.Dialogporten --version 1.57.2-rc
NuGet\Install-Package Altinn.ApiClients.Dialogporten -Version 1.57.2-rc
<PackageReference Include="Altinn.ApiClients.Dialogporten" Version="1.57.2-rc" />
paket add Altinn.ApiClients.Dialogporten --version 1.57.2-rc
#r "nuget: Altinn.ApiClients.Dialogporten, 1.57.2-rc"
// Install Altinn.ApiClients.Dialogporten as a Cake Addin #addin nuget:?package=Altinn.ApiClients.Dialogporten&version=1.57.2-rc&prerelease // Install Altinn.ApiClients.Dialogporten as a Cake Tool #tool nuget:?package=Altinn.ApiClients.Dialogporten&version=1.57.2-rc&prerelease
.NET SDK for Dialogporten ServiceOwner API
Simple overview Refit-based client SDK Based on https://github.com/altinn/altinn-apiclient-maskinporten
The refit-Interface is autogenerated with refitter. It uses OperationId to create method names. Uses refit IApiResponse on returns.
Installation
Install the nuget package through Package Manager Console:
Install-Package Altinn.ApiClients.Dialogporten
Or via .NET Core CLI:
dotnet add package Altinn.ApiClients.Dialogporten
Usage
This package needs some configuration to work. The configuration is done through the DialogportenSettings
class. The settings are as follows:
BaseUri
- The base URI of the Dialogporten API.ThrowOnPublicKeyFetchInit
- If true, the client will throw an exception if the public key fetch fails on startup. Default true.Maskinporten
- The Maskinporten settings.ClientId
- The client ID (secret).EncodedJwk
- The encoded JWK (secret).Environment
- The environment (test/prod).Scope
- Whitespace separated list of scopes to use against Dialogporten.
Registering with IServiceCollection
There are two ways to register
Register through action parameter:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDialogportenClient(x =>
{
x.BaseUri = "https://platform.tt02.altinn.no/dialogporten";
// x.ThrowOnPublicKeyFetchInit = false;
x.Maskinporten.ClientId = "YOUR_CLIENT_ID";
x.Maskinporten.EncodedJwk = "YOUR_ENCODED_JWK";
x.Maskinporten.Environment = "test";
x.Maskinporten.Scope = "digdir:dialogporten.serviceprovider digdir:dialogporten.serviceprovider.search";
}
Register through options instance parameter:
var builder = WebApplication.CreateBuilder(args);
var dialogportenSettings = builder.Configuration
.GetSection("DialogportenSettings")
.Get<DialogportenSettings>()!;
builder.Services.AddDialogportenClient(dialogportenSettings);
In this case, the configuration should look like this:
{
"DialogportenSettings": {
"BaseUri": "https://platform.tt02.altinn.no/dialogporten",
// "ThrowOnPublicKeyFetchInit": false,
"Maskinporten": {
"ClientId": "YOUR_CLIENT_ID",
"EncodedJwk": "YOUR_ENCODED_JWK",
"Environment": "test",
"Scope": "digdir:dialogporten.serviceprovider digdir:dialogporten.serviceprovider.search"
}
}
}
Available services
The following services are available after registration:
Altinn.ApiClients.Dialogporten.Features.V1.IServiceownerApi
- Used to interact with the Dialogporten ServiceOwner API.Altinn.ApiClients.Dialogporten.IDialogTokenValidator
- Used to validate Dialogporten tokens.
A background service (IHostedService
) is also registered that periodically fetches the public key from the Dialogporten API. This is required to validate dialog token signatures.
See sample project for examples on how to use the services.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- Altinn.ApiClients.Maskinporten (>= 9.2.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.2)
- NSec.Cryptography (>= 24.4.0)
- Refit (>= 8.0.0)
- Refit.HttpClientFactory (>= 8.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.57.2 | 11 | 3/3/2025 |
1.57.2-rc | 7 | 3/3/2025 |
1.57.2-alpha.1741078722 | 0 | 3/4/2025 |
1.57.1 | 32 | 2/28/2025 |
1.57.1-rc | 78 | 2/28/2025 |
1.57.1-alpha.1741001404 | 7 | 3/3/2025 |
1.57.0-rc | 75 | 2/28/2025 |
1.56.1 | 62 | 2/27/2025 |
1.56.1-rc | 101 | 2/27/2025 |
1.56.1-alpha.1740730281 | 79 | 2/28/2025 |
1.56.1-alpha.1740655679 | 97 | 2/27/2025 |
1.56.0 | 59 | 2/26/2025 |
1.56.0-rc | 123 | 2/26/2025 |
1.55.5-rc | 112 | 2/26/2025 |
1.55.4 | 87 | 2/24/2025 |
1.55.4-rc | 131 | 2/24/2025 |
1.55.4-alpha.1740568876 | 117 | 2/26/2025 |
1.55.4-alpha.1740502378 | 122 | 2/25/2025 |
1.55.4-alpha.1740471422 | 141 | 2/25/2025 |
1.55.3-rc | 75 | 2/23/2025 |
1.55.3-alpha.1740409405 | 128 | 2/24/2025 |
1.55.2 | 83 | 2/22/2025 |
1.55.2-rc | 74 | 2/22/2025 |
1.55.1-rc.d91eacb | 54 | 2/21/2025 |
1.55.1-rc.c9e10db | 48 | 2/22/2025 |
1.55.1-rc | 75 | 2/21/2025 |
1.55.0 | 90 | 2/20/2025 |
1.55.0-rc | 77 | 2/20/2025 |
1.54.0-rc.2458d6a | 53 | 2/20/2025 |
1.54.0-rc | 121 | 2/20/2025 |