Arbeidstilsynet.Common.EraClient 2.3.0

dotnet add package Arbeidstilsynet.Common.EraClient --version 2.3.0
                    
NuGet\Install-Package Arbeidstilsynet.Common.EraClient -Version 2.3.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="Arbeidstilsynet.Common.EraClient" Version="2.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arbeidstilsynet.Common.EraClient" Version="2.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Arbeidstilsynet.Common.EraClient" />
                    
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 Arbeidstilsynet.Common.EraClient --version 2.3.0
                    
#r "nuget: Arbeidstilsynet.Common.EraClient, 2.3.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 Arbeidstilsynet.Common.EraClient@2.3.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=Arbeidstilsynet.Common.EraClient&version=2.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Arbeidstilsynet.Common.EraClient&version=2.3.0
                    
Install as a Cake Tool

📖 Description

Client to interact with our external ERA APIs (OAuth protected). This client is intended to be used in all projects, where we do not have access to our internal ERA APIs, e.g. at Altinn. In order to get access to client credentials, contact #team-godkjenning.

Why did we create this package?

In many altinn applications (10) we were integrating with our ERA systems. In all of them we have duplicated code, especially in the way we did authentication. By changing all applications to use this client, we increase maintainability and make (future) migrations easier.

🧑‍💻 Usage

Add service extension in your Program.cs file:

var builder = WebApplication.CreateBuilder(args);
var appSettings = builder.Configuration.GetRequired<AppSettings>();
var services = builder.Services;
services.AddEraAdapter();

Use the need Client via DependencyInjection, available Clients are:

  • IAuthenticationClient
  • IEraAsbestClient

TBD:

  • Bemanning
  • Bilpleie
public class MyClass(IAuthenticationClient authClient) {

    private async Task<AuthenticationResponseDto> GetAuth() {
        return await authClient.Authenticate(new AuthenticationRequestDto { ... });
    }
}    
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 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. 
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
2.3.0 72 3/6/2026
2.2.3 136 2/18/2026
2.2.3-beta1 86 2/18/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. -->

## 2.3.0

### Changed

- changed(deps): Applied minor and patch updates to dependencies

## 2.2.3

### Changed

- chore: moved package to nuget.org

## 2.2.2

### Changed

- feat: use default web json serializer options with support for converting enums to string values

## 2.2.1

### Added

- feat: enhance godkjenningstatus response model with enum values
- feat: supprt for asbest behandlingsstatus endpoint

## 2.2.0

### Added

- feat: support for asbest godkjenningstatus endpoint

## 2.1.0

### Changed

- changed(deps): Applied minor and patch updates to dependencies

## 2.0.0

### Changed

- changed(deps): Major dotnet updated (v10)

## 1.2.0

### Changed

- fix(deps): use correct version range to only support Microsoft version 8.* packages

## 1.1.1

### Changed

- chore(renovate): all non major update

## 1.1.0

### Fixed

- fix: resolve URL based on HTTP context to support requests towards valid

## 1.0.0

### Added

- feat: Altinn extensions methods which can be used to reduce code duplication in our altinn projects

### Changed

- refactor: applied updated project structure to project (based on `dotnet new common-package` v1.0.0)

### Fixed

- fix: ERA endpoints require a `User-Agent` header by convention (WAF)
- fix: Updated asbest BaseURL
- fix: Retrieve the base url in runtime, since we are using a "cookie hack" to determine if we should talk to our verifi or valid environment.

## 0.0.1

### Added

- feat: Implemented AuthenticationClient which can be used to retrive an access token by providing client credentials (oauth2). The access token works for all EraClients.
- feat: Implemented EraAsbestClient to send requests to our internal asbest endpoints. Currently we support to retrieve `meldinger` for an organization as well as the status of an application (søknad).