Vettvangur.AudkenniConnect
1.2.4
dotnet add package Vettvangur.AudkenniConnect --version 1.2.4
NuGet\Install-Package Vettvangur.AudkenniConnect -Version 1.2.4
<PackageReference Include="Vettvangur.AudkenniConnect" Version="1.2.4" />
paket add Vettvangur.AudkenniConnect --version 1.2.4
#r "nuget: Vettvangur.AudkenniConnect, 1.2.4"
// Install Vettvangur.AudkenniConnect as a Cake Addin #addin nuget:?package=Vettvangur.AudkenniConnect&version=1.2.4 // Install Vettvangur.AudkenniConnect as a Cake Tool #tool nuget:?package=Vettvangur.AudkenniConnect&version=1.2.4
Vettvangur.AudkenniConnect
About
Enables easy integration with the audkenni.is authentication service.
Supports .NET Framework 4.6.1 and higher, and .NET Core 5.0 to 8.0.
Currently, this package includes two ways for user authentication against Auðkenni's API; either via sim or app.<br/>
Both are available with or without a custom verification code (aka challenge
).
Setup
Install the package from NuGet:
Install-Package Vettvangur.AudkenniConnect
Get your
ApplicationId
andApiKey
by contacting Vettvangur and add them to your app settings. <br/> Example forappsettings.json
:{ "AudkenniConnect": { "ApplicationId": "your-provided-application-id", "ApiKey": "your-provided-api-key" } }
Example for
web.config
/app.config
:<appSettings> <add key="AudkenniConnect:ApplicationId" value="your-provided-application-id" /> <add key="AudkenniConnect:ApiKey" value="your-provided-api-key" /> </appSettings>
Register AudkenniConnect where you register your services:<br/> Example for
Startup.cs
:var audkenniServiceProvider = new ServiceCollection().BuildAudkenniProvider(<fetch-api-key-from-appsettings-here>; services.AddSingleton(audkenniServiceProvider); services.AddScoped(sp => audkenniServiceProvider.GetService<AudkenniConnectService>());
Choose your method(s) - see below.
Please contact Vettvangur if you're having trouble with the setup.
High-level explanation of authorization steps:
- The client application notifies audkenni.is that a user wants to be authenticated, and gets a
challenge
code in return. - The client application displays the
challenge
code to the user, the user gets the request to his device and he provides his pin. - The client application polls the status of the authentication request until the user has finished answering the auth request on his device.
Choose your method(s)
AuthorizeWithCodeAsync
- Used for authentication with
challenge
code. <br/> - This method takes care of
step 1
from the high-level explanation above. <br/> - Used in cohesion with
GetAuthorizationStatusAsync
orPollAuthorizationStatusAsync
.
AuthorizeSimpleAsync
- This method is used on its own for a super-simplified authentication process. <br/>
- This method takes care of
steps 1-3
from the high-level explanation above; except for returning thechallenge
code to the client, a custommessage
can be used instead. <br/> - All steps of the auth-process that Auðkenni requires are handled automatically, including polling of the auth-status until the user has finished answering the auth request on his device.
NOTE: This method is NOT RECOMMENDED for app authentication as the app will always display a 4-digit challenge
, which the client application will never see. Only a custom message can be included for app authentication.
GetAuthorizationStatusAsync
- Only use this method if you want to implement the polling yourself. <br/>
- If polling is implemented correctly then this method will take care of
step 3
from the high-level explanation above. <br/> - Used in cohesion with
AuthorizeWithCodeAsync
to check if the user has authenticated. <br/>
PollAuthorizationStatusAsync
- Use this method if you don't want to implement the polling yourself. <br/>
- This method will take care of
step 3
from the high-level explanation above. <br/> - In simple terms, this method is just calling the same endpoint as
GetAuthorizationStatusAsync
, but multiple times with some delay between each call.
Please contact Vettvangur if you need help choosing the right methods for your use-case.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.1
- Microsoft.Extensions.DependencyInjection (>= 5.0.2)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Logging.Console (>= 5.0.0)
- System.Net.Http.Json (>= 5.0.0)
-
net5.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.0.0)
- Microsoft.Extensions.DependencyInjection (>= 5.0.2)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Logging.Console (>= 5.0.0)
- System.Net.Http.Json (>= 5.0.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 |
---|---|---|
1.2.4 | 338 | 8/1/2024 |
Initial release