CLI
dotnet add package Gleeman.AspNetCore.MongoIdentity
builder.Services.AddMongoIdentity(opt =>
{
opt.ConnectionString = "mongodb://localhost:27017";
opt.DatabaseName = "ExampleDB";
});
builder.Services.AddMongoIdentity(opt =>
{
opt.ConnectionString = "mongodb://localhost:27017";
opt.DatabaseName = "ExampleDB";
}).AddJwt(opt =>
{
opt.SecretKey = "f5bf2a7a-c397-4ef9-9bec-bd1255d7b26e";
opt.Audience = "this is audience";
opt.Issuer = "this is issuer";
});
app.UseAuthentication();
app.UseAuthorization();