Arbeidstilsynet.Common.Altinn
3.1.1
dotnet add package Arbeidstilsynet.Common.Altinn --version 3.1.1
NuGet\Install-Package Arbeidstilsynet.Common.Altinn -Version 3.1.1
<PackageReference Include="Arbeidstilsynet.Common.Altinn" Version="3.1.1" />
<PackageVersion Include="Arbeidstilsynet.Common.Altinn" Version="3.1.1" />
<PackageReference Include="Arbeidstilsynet.Common.Altinn" />
paket add Arbeidstilsynet.Common.Altinn --version 3.1.1
#r "nuget: Arbeidstilsynet.Common.Altinn, 3.1.1"
#:package Arbeidstilsynet.Common.Altinn@3.1.1
#addin nuget:?package=Arbeidstilsynet.Common.Altinn&version=3.1.1
#tool nuget:?package=Arbeidstilsynet.Common.Altinn&version=3.1.1
Arbeidstilsynet.Common.Altinn
A collection of common patterns and extensions for cross-cutting concerns for applications which need to interact with Altinns APIs.
📖 Installation
To install the package, use the following command in your terminal:
dotnet add package Arbeidstilsynet.Common.Altinn
🚀 Features
- Extension Methods for common Altinn operations
- Altinn Adapter Provides a high-level abstraction for Arbeidstilsynet’s integration needs, streamlining communication with Altinn instances.
- Altinn API Clients Robust REST API clients for direct and flexible interaction with Altinn’s services, supporting both general and advanced use cases.
🧑💻 Usage
Dependency Injection Setup
Consuming Altinn Instances
var builder = WebApplication.CreateBuilder(args);
var services = builder.Services;
var appSettings = builder.Configuration.GetRequired<MyAppSettings>();
// Adds IAltinnAdapter, which abstracts communication with Altinn instances.
services.AddAltinnAdapter(builder.Environment, appSettings.MaskinportenConfiguration);
// Adds Altinn API clients for consuming Altinn services, at a lower level of abstraction than IAltinnAdapter
services.AddAltinnApiClients(builder.Environment, appSettings.MaskinportenConfiguration);
🤝 Contributing
This library follows standard .NET conventions and includes comprehensive unit tests. When contributing:
- Add unit tests for new functionality
- Follow existing code patterns
- Update documentation for new features
- Ensure all tests pass
📄 License
This project is licensed under the terms specified by Arbeidstilsynet.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Http.Resilience (>= 10.5.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.17.0)
- Microsoft.IdentityModel.Tokens (>= 8.17.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 |
|---|---|---|
| 3.1.1 | 1,826 | 4/30/2026 |
| 3.1.0 | 270 | 4/29/2026 |
| 3.1.0-alpha3 | 99 | 4/29/2026 |
| 3.1.0-alpha2 | 126 | 4/28/2026 |
| 3.1.0-alpha | 166 | 4/28/2026 |
| 3.0.0 | 131 | 4/27/2026 |
| 2.6.1 | 196 | 4/27/2026 |
| 2.6.1-alpha | 97 | 4/22/2026 |
| 2.6.0 | 1,494 | 3/17/2026 |
| 2.6.0-alpha9 | 105 | 3/17/2026 |
| 2.6.0-alpha8 | 117 | 3/17/2026 |
| 2.6.0-alpha7 | 135 | 3/16/2026 |
| 2.6.0-alpha6 | 104 | 3/16/2026 |
| 2.6.0-alpha5 | 139 | 3/16/2026 |
| 2.6.0-alpha4 | 108 | 3/13/2026 |
| 2.6.0-alpha3 | 118 | 3/13/2026 |
| 2.6.0-alpha2 | 105 | 3/13/2026 |
| 2.6.0-alpha10 | 124 | 3/17/2026 |
| 2.6.0-alpha | 133 | 3/12/2026 |
| 2.5.0 | 143 | 3/6/2026 |
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added <!-- for new features. -->
### Changed <!-- for changes in existing functionality. -->
### Deprecated <!-- for soon-to-be removed features. -->
### Removed <!-- for now removed features. -->
### Fixed <!-- for any bug fixes. -->
### Security <!-- in case of vulnerabilities. -->
## 3.1.1
### Fixed
- fix(altinn): added necessary null checks when converting an altinn instance to metadata
## 3.1.0
### Added
- feat(altinn): Enhace `AltinnMetaData` to include dialogId and all DataValues which come from an altinn instance.
- feat(altinn): Added ``AltinnDialogportenClient`` to support communication with dialogporten. Can be injected via ``IAltinnDialogportenClient`` and requires a maskinporten integration with the following altinn scope to work: `altinn:serviceowner`. Right now the client only supports one method to retrieve a dialogId based on an instanceId.
- fix(extensions): make all methods in `HostEnvironmentExtensions` publicly available
## 3.0.0
### Removed
- **BREAKING**: Removed dependency on `Arbeidstilsynet.Common.AspNetCore.Extensions`
### Changed
- Added `FrameworkReference` to `Microsoft.AspNetCore.App` for ASP.NET Core types
## 2.6.1
### Changed
- changed(deps): Applied minor and patch updates to dependencies
## 2.6.0
### Added
- feat(altinn): Added ``AltinnCorrespondenceClient`` to support posting correspondences, with and without attachments. Can be injected via ``IAltinnCorrespondenceClient`` and requires a maskinporten integration with the following altinn scope to work: `altinn:correspondence.write`. It is also possible to retrieve a correspondence by ID.
- feat(altinn): Added ``AltinnMeldingerAdapter`` to make usage of the ``IAltinnCorrespondenceClient`` easier. Can be injected via ``IAltinnMeldingerAdapter``.
### Changed
- feat(maskinporten): Updated MaskinportenConfiguration to also support jwt token generation which includes a key identifier (`kid`) instead of only supporting identification by a certificate chain.
## 2.5.0
### Changed
- changed(deps): Applied minor and patch updates to dependencies
## 2.4.2
### Fixed
- Fixed a bug where a partial altinn configuration would overwrite defaults.
## 2.4.1
### Changed
- chore: moved package to nuget.org
## 2.4.0
### Added
- feat(altinn): Differentiate between structured data and the main content of the instance.
- Implements the StructuredData configuration from AltinnApp 2.4.0.
- Adds DataType and Id from the Altinn DataElement to the FileMetadata of the AltinnDocument.
## 2.3.0
### Added
- feat(altinn): Enhanced ``AltinnEventsClient`` to support retrieving details for a subscriptions. Also updated ``IAltinnAdapter`` to implement a convenience method for getting these details.
## 2.2.0
### Changed
- changed(deps): Applied minor and patch updates to dependencies
## 2.1.0
### Added
- feat(altinn): Enhanced ``AltinnEventsClient`` to support Unsubscribing. Also updated ``IAltinnAdapter`` to implement a convenience method for unsubscribing.
## 2.0.2
### Added
- feat(altinn): Added function to return only metadata for non completed instances (in order to not download attachments)
## 2.0.1
### Changed
- changed(deps): Updated internal package referances (remove prerelease version)
## 2.0.0
### Changed
- changed(deps): Major dotnet updated (v10)
## 1.4.0
### Changed
- changed: using "structured-data" as default dataType for MainDocument.
## 1.3.2
### Added
- chore: added extension methods to create a Dictionary based on `AltinnMetadata`.
## 1.3.1
### Fixed
- fix: add nullable declarations to `AltinnCloudEvent` dto to enable usage in a dotnet Controller.
## 1.3.0
### Changed
- changed: split up package to only contain logic to communicate with Altinns API. All logic with is only relevant for altinn apps was moved to the new AltinnApp package.
## 1.2.0
### Changed
- fix(deps): use correct version range to only support Microsoft version 8.* packages
## 1.1.0
### Fixed
- fix: move complete action to new "Apps Client" since all mutable instance actions must go through Apps Api instead of Storage Api
## 1.0.0
### Added
- feat: add altinn token provider and clients to handle token exchange
## 0.0.4
### Changed
- chore: enhance altinn metadata with process started / ended
## 0.0.3
### Changed
- chore(renovate): all non major update
## 0.0.2
### Changed
- chore(altinn-adapter): update FileMetadata model to return an enum of FileScanResults instead of a string
## 0.0.1
### Added
- **API Clients** to be used to consume public Altinn APIs
- `Storage Api Client` for the storage API (Instance Data)
- `Event Api Client` for the event API (Subscriptions)
- **Extension Methods** for common Altinn operations
- `InstanceExtensions` - Extract GUID, app name, and party ID from instances
- `DataClientExtensions` - Simplified form data retrieval and element deletion
- `AssemblyExtensions` - Load and deserialize embedded JSON resources
- **Abstract Data Processors** for handling form data changes
- `BaseDataProcessor<T>` - Base class for type-specific data processing
- `MemberProcessor<T, TMember>` - Process changes to specific object members
- `ListProcessor<T, TItem>` - Handle list/collection changes with item-level processing
- **Country Code Lookup Service** (`ILandskodeLookup`)
- Country anmes and dial codes for 238 countries
- **Altinn Options Provider** for country dropdowns
- `LandOptions` for Altinn dropdowns etc.