Vettvangur.AudkenniConnect
2.3.1
dotnet add package Vettvangur.AudkenniConnect --version 2.3.1
NuGet\Install-Package Vettvangur.AudkenniConnect -Version 2.3.1
<PackageReference Include="Vettvangur.AudkenniConnect" Version="2.3.1" />
<PackageVersion Include="Vettvangur.AudkenniConnect" Version="2.3.1" />
<PackageReference Include="Vettvangur.AudkenniConnect" />
paket add Vettvangur.AudkenniConnect --version 2.3.1
#r "nuget: Vettvangur.AudkenniConnect, 2.3.1"
#:package Vettvangur.AudkenniConnect@2.3.1
#addin nuget:?package=Vettvangur.AudkenniConnect&version=2.3.1
#tool nuget:?package=Vettvangur.AudkenniConnect&version=2.3.1
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 | 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 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. |
-
net8.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.1)
- Microsoft.Extensions.Http (>= 10.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.1)
- Microsoft.Extensions.Logging.Console (>= 10.0.1)
- System.Net.Http.Json (>= 10.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
.net8+ support