AspNetCore.IdentityServer.Mongo
1.1.1
dotnet add package AspNetCore.IdentityServer.Mongo --version 1.1.1
NuGet\Install-Package AspNetCore.IdentityServer.Mongo -Version 1.1.1
<PackageReference Include="AspNetCore.IdentityServer.Mongo" Version="1.1.1" />
paket add AspNetCore.IdentityServer.Mongo --version 1.1.1
#r "nuget: AspNetCore.IdentityServer.Mongo, 1.1.1"
// Install AspNetCore.IdentityServer.Mongo as a Cake Addin #addin nuget:?package=AspNetCore.IdentityServer.Mongo&version=1.1.1 // Install AspNetCore.IdentityServer.Mongo as a Cake Tool #tool nuget:?package=AspNetCore.IdentityServer.Mongo&version=1.1.1
AspNetCore.IdentityServer.Mongo
Introduction
MongoDB provider for Duende IdentityServer.
Supports the following stores in the configuration data:
- Client store for Client data.
- CORS policy service for CORS support.
- Resource store for IdentityResource, ApiResource, and ApiScope data.
- Identity Provider store for IdentityProvider 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
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
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
- Duende IdentityServer Data Stores and Persistence.
- Duende IdentityServer
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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 is compatible. 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. |
-
.NETCoreApp 3.1
- AutoMapper (>= 10.1.1 && < 11.0.0)
- Duende.IdentityServer (>= 5.2.4)
- Duende.IdentityServer.Storage (>= 5.2.4)
- MongoDB.Analyzer (>= 1.2.0)
- MongoDB.Bson (>= 2.19.1)
- MongoDB.Driver (>= 2.19.1)
-
net6.0
- AutoMapper (>= 10.1.1 && < 11.0.0)
- Duende.IdentityServer (>= 5.2.4)
- Duende.IdentityServer.Storage (>= 5.2.4)
- MongoDB.Analyzer (>= 1.2.0)
- MongoDB.Bson (>= 2.19.1)
- MongoDB.Driver (>= 2.19.1)
-
net7.0
- AutoMapper (>= 10.1.1 && < 11.0.0)
- Duende.IdentityServer (>= 5.2.4)
- Duende.IdentityServer.Storage (>= 5.2.4)
- MongoDB.Analyzer (>= 1.2.0)
- MongoDB.Bson (>= 2.19.1)
- MongoDB.Driver (>= 2.19.1)
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,648 | 4/20/2023 |
1.1.0 | 12,885 | 11/8/2021 |
1.1.0-preview | 197 | 10/13/2021 |
1.0.0 | 210 | 10/12/2021 |