Revoke.NET MongoDB Store Extension
$ dotnet add package Revoke.NET.MongoDBMongoDB BlackList Store Extension for [Revoke.NET] (https://www.nuget.org/packages/Revoke.NET)
Install the Revoke.NET.MongoDB NuGet package into your app
PM> Install-Package Revoke.NET.MongoDB
using MongoDB.Driver;
using Revoke.NET;
using Revoke.NET.MongoDB;
var store = await MongoBlackListStore.CreateStoreAsync("RevokeStore",
MongoClientSettings.FromConnectionString("mongodb://127.0.0.1:27017/RevokeStore"));
var key = "[ID String of something to be blacklisted]";
await store.Revoke(key, TimeSpan.FromHours(24)); // Revoke access to a key for 24 hours
await store.IsRevoked(key); // Check if key is blacklisted
await store.Delete(key); // Delete a key from blacklist
Install the Revoke.NET.AspNetCore NuGet package
PM> Install-Package Revoke.NET.AspNetCore
using Revoke.NET;
using Revoke.NET.MongoDB;
using Revoke.NET.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRevokeMongoStore();