AspNetCore.IdentityServer.Mongo
1.1.0-preview
See the version list below for details.
dotnet add package AspNetCore.IdentityServer.Mongo --version 1.1.0-preview
NuGet\Install-Package AspNetCore.IdentityServer.Mongo -Version 1.1.0-preview
<PackageReference Include="AspNetCore.IdentityServer.Mongo" Version="1.1.0-preview" />
paket add AspNetCore.IdentityServer.Mongo --version 1.1.0-preview
#r "nuget: AspNetCore.IdentityServer.Mongo, 1.1.0-preview"
// Install AspNetCore.IdentityServer.Mongo as a Cake Addin #addin nuget:?package=AspNetCore.IdentityServer.Mongo&version=1.1.0-preview&prerelease // Install AspNetCore.IdentityServer.Mongo as a Cake Tool #tool nuget:?package=AspNetCore.IdentityServer.Mongo&version=1.1.0-preview&prerelease
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 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. |
-
.NETCoreApp 3.1
- AutoMapper (>= 10.1.1 && < 11.0.0)
- Duende.IdentityServer (>= 5.2.3)
- Duende.IdentityServer.Storage (>= 5.2.3)
- MongoDB.Bson (>= 2.13.2)
- MongoDB.Driver (>= 2.13.2)
-
net5.0
- AutoMapper (>= 10.1.1 && < 11.0.0)
- Duende.IdentityServer (>= 5.2.3)
- Duende.IdentityServer.Storage (>= 5.2.3)
- MongoDB.Bson (>= 2.13.2)
- MongoDB.Driver (>= 2.13.2)
-
net6.0
- AutoMapper (>= 10.1.1 && < 11.0.0)
- Duende.IdentityServer (>= 5.2.3)
- Duende.IdentityServer.Storage (>= 5.2.3)
- MongoDB.Bson (>= 2.13.2)
- MongoDB.Driver (>= 2.13.2)
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,605 | 4/20/2023 |
1.1.0 | 12,582 | 11/8/2021 |
1.1.0-preview | 195 | 10/13/2021 |
1.0.0 | 202 | 10/12/2021 |