This repository contains custom middleware and other additions for ASP.NET Core.
Currently, this package provides middleware that uses the Microsoft Graph API to add claims for every Active Directory group an authenticated user is a member of. For this, it relies on the Microsoft.Identity.Web code which was not officially released on NuGet. We have provided a NuGet package for this, with some minor changes to reduce the required dependencies.
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddGraphApiClaims(); // <--
// ...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseAuthentication();
app.UseGraphApiClaims(); // <--
app.UseMvc();
}
This package provides a QueueBackgroundWorkItem implementation as provided in aspnet/Extensions issue #805.
Use the IServiceCollection.AddBackgroundTasks extension to provide an IBackgroundTaskQueue for queueing work items and a hosted service that runs the queue.