AspNetCore.IdentityServer.Mongo 1.1.0

This package has a SemVer 2.0.0 package version: 1.1.0+build.6.
There is a newer version of this package available.
See the version list below for details.
dotnet add package AspNetCore.IdentityServer.Mongo --version 1.1.0                
NuGet\Install-Package AspNetCore.IdentityServer.Mongo -Version 1.1.0                
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="AspNetCore.IdentityServer.Mongo" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AspNetCore.IdentityServer.Mongo --version 1.1.0                
#r "nuget: AspNetCore.IdentityServer.Mongo, 1.1.0"                
#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 AspNetCore.IdentityServer.Mongo as a Cake Addin
#addin nuget:?package=AspNetCore.IdentityServer.Mongo&version=1.1.0

// Install AspNetCore.IdentityServer.Mongo as a Cake Tool
#tool nuget:?package=AspNetCore.IdentityServer.Mongo&version=1.1.0                

AspNetCore.IdentityServer.Mongo

CI contributions welcome

Introduction

MongoDB provider for Duende IdentityServer.

Supports the following stores in the configuration data:

Supports the following stores in the operational data:

  • Grants for authorization and device codes, reference and refresh tokens, and remembered user consent.
  • Keys managing dynamically created signing keys.

Installation

NuGet

Install the AspNetCore.IdentityServer.Mongo NuGet package from the .NET Core CLI using:

dotnet add package AspNetCore.IdentityServer.Mongo

or from the NuGet package manager:

Install-Package AspNetCore.IdentityServer.Mongo

Or alternatively, you can add the AspNetCore.IdentityServer.Mongo package from within Visual Studio's NuGet package manager.

Usage

alternate text is missing from this package README image

Configuration Store

For storing configuration data, the configuration store can be used. This support provides implementations of the IClientStore, IResourceStore, IIdentityProviderStore, and the ICorsPolicyService extensibility points.

To use the configuration store support, use the AddConfigurationStore extension method after the call to AddIdentityServer:

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    // Register MongoDB in the DI as usual, for example:
    services.AddSingleton<IMongoClient>(s =>
    {
        var mcs = MongoClientSettings.FromUrl(new MongoUrl(connectionString));
        return new MongoClient(mcs);
    });

    services.AddIdentityServer()
            // this adds the config data from DB (clients, resources, CORS)
            .AddConfigurationStore(options =>
            {
                options.DatabaseName = "<YOUR CONFIGURATION DATABASE NAME>";
            });
}

To configure the configuration store, use the ConfigurationStoreOptions options object passed to the configuration callback.

Operational Store

For storing operational data, the operational store can be used. This support provides implementations of the IPersistedGrantStore, IDeviceFlowStore, and ISigningKeyStore extensibility points.

To use the operational store support, use the AddOperationalStore extension method after the call to AddIdentityServer:

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    // Register MongoDB in the DI as usual, for example:
    services.AddSingleton<IMongoClient>(s =>
    {
        var mcs = MongoClientSettings.FromUrl(new MongoUrl(connectionString));
        return new MongoClient(mcs);
    });

    services.AddIdentityServer()
            // this adds the operational data from DB (codes, tokens, consents)
            .AddOperationalStore(options =>
            {
                options.DatabaseName = "<YOUR OPERATIONAL DATABASE NAME>";

                // this enables automatic token cleanup. this is optional.
                options.EnableTokenCleanup = true;
                options.RemoveConsumedTokens = true;
                options.TokenCleanupInterval = 3600; // interval in seconds (default is 3600)
            });
}

To configure the operational store, use the OperationalStoreOptions options object passed to the configuration callback.

Collection names uses PascalCase but can be customized as needed using the corresponding configuration options.

Samples

Contains samples for IdentityServer and IdentityServer with ASP.NET Identity integration.

Learn More

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 Core netcoreapp3.1 is compatible. 
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
1.1.1 2,530 4/20/2023
1.1.0 12,084 11/8/2021
1.1.0-preview 188 10/13/2021
1.0.0 197 10/12/2021