laget.PskAuthentication.Mvc
1.0.18
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package laget.PskAuthentication.Mvc --version 1.0.18
NuGet\Install-Package laget.PskAuthentication.Mvc -Version 1.0.18
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="laget.PskAuthentication.Mvc" Version="1.0.18" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add laget.PskAuthentication.Mvc --version 1.0.18
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: laget.PskAuthentication.Mvc, 1.0.18"
#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.
// Install laget.PskAuthentication.Mvc as a Cake Addin #addin nuget:?package=laget.PskAuthentication.Mvc&version=1.0.18 // Install laget.PskAuthentication.Mvc as a Cake Tool #tool nuget:?package=laget.PskAuthentication.Mvc&version=1.0.18
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
laget.PskAuthentication
Default implementation of Secure Pre-Shared Key (PSK) Authentication for laget.se using Rijndael.
Configuration
This example is shown using Autofac since this is the go-to IoC for us.
public class OptionModule : Module
{
readonly IConfiguration _configuration;
public OptionModule(IConfiguration configuration)
{
_configuration = configuration;
}
protected override void Load(ContainerBuilder builder)
{
builder.Register(c => new PskAuthenticationAttribute(new PskAuthenticationOptions
{
RijndaelKey = _configuration.GetValue<string>("Security:RijndaelKey"),
RijndaelIV = _configuration.GetValue<string>("Security:RijndaelIV"),
Salt = _configuration.GetValue<string>("Security:Salt"),
Secret = _configuration.GetValue<string>("Security:Secret")
})).AsSelf();
}
}
appsettings.json
"Security": {
"RijndaelIV": "...",
"RijndaelKey": "...",
"Salt": "...",
"Secret": "..."
}
Usage
Controller
[PskAuthentication]
public class SomeController : ControllerBase
{
}
Rijndael
You can generate the necessary Rijndael properties via the code below or visit https://rextester.com/EFWCK32767
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Security.Cryptography;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
var Rijndael = new RijndaelManaged();
Rijndael.GenerateIV();
Rijndael.GenerateKey();
Console.WriteLine(Convert.ToBase64String(Rijndael.IV));
Console.WriteLine(Convert.ToBase64String(Rijndael.Key));
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
-
.NETStandard 2.1
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
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.8 | 108 | 10/30/2024 |
2.2.5 | 283 | 2/9/2024 |
2.1.4 | 251 | 1/20/2024 |
2.1.3 | 193 | 9/28/2023 |
2.0.1 | 177 | 9/19/2023 |
1.0.25 | 299 | 3/10/2023 |
1.0.24 | 235 | 3/10/2023 |
1.0.23 | 367 | 12/5/2022 |
1.0.22 | 434 | 10/27/2022 |
1.0.21 | 484 | 7/8/2022 |
1.0.20 | 502 | 2/9/2022 |
1.0.18 | 495 | 8/16/2021 |
1.0.17 | 424 | 7/5/2021 |
1.0.16 | 461 | 4/6/2021 |
1.0.15 | 413 | 3/5/2021 |
1.0.14 | 501 | 2/1/2021 |
1.0.13 | 779 | 12/23/2020 |
1.0.12 | 456 | 12/22/2020 |
1.0.11 | 513 | 12/16/2020 |
1.0.10 | 530 | 12/12/2020 |
1.0.9 | 546 | 12/12/2020 |
1.0.8 | 459 | 12/11/2020 |