ApiFeatures.Authentications.Sessions.MongoDatabases
9.0.0
dotnet add package ApiFeatures.Authentications.Sessions.MongoDatabases --version 9.0.0
NuGet\Install-Package ApiFeatures.Authentications.Sessions.MongoDatabases -Version 9.0.0
<PackageReference Include="ApiFeatures.Authentications.Sessions.MongoDatabases" Version="9.0.0" />
<PackageVersion Include="ApiFeatures.Authentications.Sessions.MongoDatabases" Version="9.0.0" />
<PackageReference Include="ApiFeatures.Authentications.Sessions.MongoDatabases" />
paket add ApiFeatures.Authentications.Sessions.MongoDatabases --version 9.0.0
#r "nuget: ApiFeatures.Authentications.Sessions.MongoDatabases, 9.0.0"
#:package ApiFeatures.Authentications.Sessions.MongoDatabases@9.0.0
#addin nuget:?package=ApiFeatures.Authentications.Sessions.MongoDatabases&version=9.0.0
#tool nuget:?package=ApiFeatures.Authentications.Sessions.MongoDatabases&version=9.0.0
ApiFeatures.Authentications.Sessions.MongoDatabases
MongoDB database implementation for the Session Authentication feature.
Overview
This package provides MongoDB storage support for the ApiFeatures.Authentications.Sessions library. It separates MongoDB-specific concerns from the core session authentication functionality.
Installation
dotnet add package ApiFeatures.Authentications.Sessions.MongoDatabases
Usage
using ApiFeatures.Authentications.Sessions.Extensions;
using ApiFeatures.Authentications.Sessions.MongoDatabases.Extensions;
using ApiFeatures.Authentications.Sessions.MongoDatabases.Models.Options;
var builder = WebApplication.CreateBuilder(args);
// Configure session authentication with MongoDB
var mongoOptions = new MongoSessionAuthenticationDatabaseOptions
{
ConnectionString = "mongodb://localhost:27017",
DatabaseName = "SessionAuthDb",
Collection = new MongoDatabaseCollectionOptions
{
Sessions = "sessions"
}
};
builder.Services.AddSessionAuthenticationFeature(options => options
.WithBusinessLogic<YourBusinessLogic>()
.WithMongoDatabase(mongoOptions)
// ... other configurations
);
Features
- MongoSessionService: MongoDB implementation of
ISessionService - SessionDatabaseContext: MongoDB database context with proper serialization
- MongoSessionAuthenticationDatabaseOptions: Configuration options for MongoDB connection
- Extension Methods: Fluent API for easy configuration
Components Moved from Core Package
This package contains the following components that were previously in ApiFeatures.Authentications.Sessions:
MongoSessionService- MongoDB session service implementationSessionDatabaseContext- MongoDB database contextMongoSessionAuthenticationDatabaseOptions- MongoDB configuration optionsMongoDatabaseCollectionOptions- Collection naming options
Dependencies
- ApiFeatures.Authentications.Sessions
- MongoDB.Driver (3.7.0)
- BusinessFeatures.Cores
Migration Guide
If you were previously using MongoDB with the core ApiFeatures.Authentications.Sessions package:
- Install this package:
dotnet add package ApiFeatures.Authentications.Sessions.MongoDatabases - Add using statement:
using ApiFeatures.Authentications.Sessions.MongoDatabases.Extensions; - Replace
.WithDatabase(mongoOptions)with.WithMongoDatabase(mongoOptions)
License
[Your License Here]
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- ApiFeatures.Authentications.Sessions (>= 9.0.0)
- BusinessFeatures.Cores (>= 9.0.1)
- MongoDB.Driver (>= 3.7.0)
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 |
|---|---|---|
| 9.0.0 | 34 | 5/7/2026 |