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
<PackageReference Include="Arbeidstilsynet.Common.EraClient" Version="2.3.0" />
<PackageVersion Include="Arbeidstilsynet.Common.EraClient" Version="2.3.0" />
<PackageReference Include="Arbeidstilsynet.Common.EraClient" />
paket add Arbeidstilsynet.Common.EraClient --version 2.3.0
#r "nuget: Arbeidstilsynet.Common.EraClient, 2.3.0"
#:package Arbeidstilsynet.Common.EraClient@2.3.0
#addin nuget:?package=Arbeidstilsynet.Common.EraClient&version=2.3.0
#tool nuget:?package=Arbeidstilsynet.Common.EraClient&version=2.3.0
📖 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 | 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 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.AspNetCore.Http (>= 2.3.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Http.Resilience (>= 10.3.0)
-
net8.0
- Microsoft.AspNetCore.Http (>= 2.3.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Http.Resilience (>= 10.3.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 |
|---|---|---|
| 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).