Altinn.ApiClients.Dialogporten 1.57.1-rc

This is a prerelease version of Altinn.ApiClients.Dialogporten.
This package has a SemVer 2.0.0 package version: 1.57.1-rc+2170a3d.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Altinn.ApiClients.Dialogporten --version 1.57.1-rc                
NuGet\Install-Package Altinn.ApiClients.Dialogporten -Version 1.57.1-rc                
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="Altinn.ApiClients.Dialogporten" Version="1.57.1-rc" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Altinn.ApiClients.Dialogporten --version 1.57.1-rc                
#r "nuget: Altinn.ApiClients.Dialogporten, 1.57.1-rc"                
#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 Altinn.ApiClients.Dialogporten as a Cake Addin
#addin nuget:?package=Altinn.ApiClients.Dialogporten&version=1.57.1-rc&prerelease

// Install Altinn.ApiClients.Dialogporten as a Cake Tool
#tool nuget:?package=Altinn.ApiClients.Dialogporten&version=1.57.1-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:

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