Vettvangur.AudkenniConnect 2.3.1

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

Vettvangur.AudkenniConnect

About & Usage

Enables easy integration with the audkenni.is authentication service

Supports .NET Framework 8.0 and higher.

Currently this package includes two ways for authentication; either via sim or app and, both are available with and without custom verification code. <center>

"With verification code, or not with verfication code ... that is the question."

</center>

BuildAudkenniProvider

Registers the AudkenniConnect service and immediately builds the service provider.

Signature
public static IServiceProvider BuildAudkenniProvider(
    this IServiceCollection services,
    string apiKey)
Parameters
  • services (IServiceCollection): The service collection to add the services to.
  • apiKey (string): The API key used for authentication with the Audkenni API.

Configuration

The service can be configured through appsettings.json or other configuration sources using the VettvangurAudkenni section.

Configuration Options

VettvangurAudkenni:ApiUrl

Specifies a custom API URL to override the default production URL.

  • Type: string
  • Required: No
  • Default: https://audkenni.vettvangur.is/
VettvangurAudkenni:Staging

When set to true, uses the staging environment instead of production. This setting takes precedence over ApiUrl.

  • Type: boolean
  • Required: No
  • Default: false
  • Staging URL: https://staging.audkenni.vettvangur.is/

Configuration Examples

Example 1: Using Production (Default)
{
  "VettvangurAudkenni": {
    "ApiUrl": "https://audkenni.vettvangur.is/"
  }
}

Or simply omit the configuration section entirely to use the default production URL.

Example 2: Using Staging Environment
{
  "VettvangurAudkenni": {
    "Staging": true
  }
}
Example 3: Using Custom API URL
{
  "VettvangurAudkenni": {
    "ApiUrl": "https://custom-api.example.com/"
  }
}
Example 4: Staging Takes Precedence
{
  "VettvangurAudkenni": {
    "ApiUrl": "https://custom-api.example.com/",
    "Staging": true
  }
}

<details> <summary><code>AuthorizeSimple</code></summary>

Used on it's own for a simple authentication process.

Polling for the users' input is done automatically.


NOTE: Not reccomended for app authentication. The app will always display a verification code while the client will never see it. Only a message (not a verific. code) can be included for app authentication in this endpoint.


</details>

<details> <summary><code>AuthorizeWithCode</code></summary>

Used in cohersion with <code>GetAuthorizationStatus</code>.

Used for authentication with verification code i.e. the client will handle polling while waiting for the user to authenticate.

Recommended for both sim and app authentication.

</details>

<details> <summary><code>GetAuthorizationStatus</code></summary>

Used in cohersion with <code>AuthorizeWithCode</code> to check if the user has authenticated. <br/> Please use <code>PollAuthorizationStatus</code> instead if you want us to handle the polling for you; otherwise you have to implement the polling funcitonality yourself. </details>

<details> <summary><code>PollAuthorizationStatus</code></summary>

This endpoint automatically polls for the auth-status. This is useful if you don't want to implement the polling for the auth-status by yourself. <br/> Used in cohersion with <code>AuthorizeWithCode</code> to check if the user has authenticated. </details>

Project Setup

<details> <summary><strong>Clone the project</strong></summary>

git clone https://github.com/Vettvangur/Vettvangur.AudkenniConnect.git

</details>

<details> <summary><strong>Restore NuGet Packages</strong></summary>

Right Click Solution > Restore NuGet Packages

If the restore function is not available then it can be found here:
Right Click Solution > Manage NuGet Packages > Click the restore button located at the top.

</details>

<details> <summary><strong>Build the solution</strong></summary>

CTRL + SHIFT + B
-or-
Build > Build Solution

</details>

Run a manual test

<details> <summary><strong>Change Config.cs</strong></summary>

Open AudkenniConnect.Tests > Config.cs and change the following values:
- apiUrl: The url to the AudkenniConnect API.
- apiKey: The API key for the AudkenniConnect API.
- inputPhoneNumber: The phone number used for authentication.
- inputSsn: The national id used for authentication. (Kennitala)
- requestingApplication: The name of the application requesting authentication.

</details>

<details> <summary><strong>Select the correct test</strong></summary>

In Visual Studio open Test Explorer and select the test you want to run. 
Make sure the correct version of dotnet is used when selecting a test.

</details>

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 was computed.  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.1 211 2/11/2026
2.3.0 117 2/11/2026
2.2.0 122 2/10/2026
2.1.1 223 12/22/2025
1.2.4 1,839 8/1/2024

.net8+ support