Veracity.Authentication.OpenIDConnect.Core 1.1.0 The ID prefix of this package has been reserved for one of the owners of this package by Prefix Reserved

.NET Core 2.1
Install-Package Veracity.Authentication.OpenIDConnect.Core -Version 1.1.0
dotnet add package Veracity.Authentication.OpenIDConnect.Core --version 1.1.0
<PackageReference Include="Veracity.Authentication.OpenIDConnect.Core" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Veracity.Authentication.OpenIDConnect.Core --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Veracity.Authentication.OpenIDConnect.Core, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Veracity.Authentication.OpenIDConnect.Core as a Cake Addin
#addin nuget:?package=Veracity.Authentication.OpenIDConnect.Core&version=1.1.0

// Install Veracity.Authentication.OpenIDConnect.Core as a Cake Tool
#tool nuget:?package=Veracity.Authentication.OpenIDConnect.Core&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Converting from Veracity.Authentication.OpenIDConnect.* to Veracity.Common.Authentication.*

As we have changed our strategy to provide a unified set of packages that build upon eachother with authientication as the foundation we have deprecated the Veracity.Authentication.OpenIDConnect.* packages. This guide will help in the process of upgrading to the new packages.

We now support different options with regards of token caching through the Microsoft.Extensions.Caching namespace. This provides an easy and standard way of setting up the caching strategy that is most siutable for your solution. Note that persistent token chacing like redis and sql require you to encrupt the tokens before storing them. We also provide options for doing this.


  1. Remove the old package
  2. install the package: Install-Package Veracity.Common.Authentication.AspNetCore
  3. Remove ConfigureServices(s=>s.AddSingleton<IVeracityIntegrationConfigService, VeracityIntegrationConfigService>()) from program.cs
  4. Remove ConfigureServices(s=>s.AddSingleton<IVeracityOpenIdManager, VeracityOpenIdManager>()) from program.cs
  5. Change Constructor, se sample below
  6. Replace services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>() with services.AddVeracity(Configuration)
  7. Remove: services.AddHttpClient<VeracityPlatformService>();
  8. Remove: services.AddSession()
  9. Replace AddOpenIdConnect with AddVeracityAuthentication(Configuration)
  10. Add token cache, see sample
  11. Add DataProtection, see sample

Startup.cs constructor, uses key vault for secrets

public Startup(IHostingEnvironment env)
    var azureServiceTokenProvider = new AzureServiceTokenProvider();
    var builder = new ConfigurationBuilder()
        .AddJsonFile("appsettings.json", true, true)
        .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true, true)
        .AddAzureKeyVault("", new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback)), new DefaultKeyVaultSecretManager())
    Configuration = builder.Build();

Startup.cs ConfigureServices

public void ConfigureServices(IServiceCollection services)
        .AddSingleton(ConstructDistributedCache).Configure<CookiePolicyOptions>(options =>
        // This lambda determines whether user consent for non-essential cookies is needed for a given request.
        options.CheckConsentNeeded = context => true;
        options.MinimumSameSitePolicy = SameSiteMode.None;
    }).AddAuthentication(sharedOptions =>
            sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;


Create token cache

private IDistributedCache ConstructDistributedCache(IServiceProvider s)
    return new MemoryDistributedCache(new OptionsWrapper<MemoryDistributedCacheOptions>(new MemoryDistributedCacheOptions()));

Create dataprotector

private IDataProtector ConstructDataProtector(IServiceProvider s)
    return new DataProtector<IDataProtectionProvider>(s.GetDataProtectionProvider(), (p, data) => p.CreateProtector("token").Protect(data), (p, data) => p.CreateProtector("token").Unprotect(data));
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
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
1.1.0 6,651 12/6/2018
1.0.0 534 11/19/2018

Initial release