Stardust.Aadb2c.AuthenticationFilter
2.0.1.1
.NET Core 2.0
This package targets .NET Core 2.0. The package is compatible with this framework or higher.
.NET Framework 4.7.1
This package targets .NET Framework 4.7.1. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Stardust.Aadb2c.AuthenticationFilter --version 2.0.1.1
NuGet\Install-Package Stardust.Aadb2c.AuthenticationFilter -Version 2.0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Stardust.Aadb2c.AuthenticationFilter" Version="2.0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Stardust.Aadb2c.AuthenticationFilter --version 2.0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Stardust.Aadb2c.AuthenticationFilter, 2.0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Stardust.Aadb2c.AuthenticationFilter as a Cake Addin #addin nuget:?package=Stardust.Aadb2c.AuthenticationFilter&version=2.0.1.1 // Install Stardust.Aadb2c.AuthenticationFilter as a Cake Tool #tool nuget:?package=Stardust.Aadb2c.AuthenticationFilter&version=2.0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
.net Framework
add filter
In WebApiConfig.cs add
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
// config.SuppressDefaultHostAuthentication();
// Web API routes
config.MapHttpAttributeRoutes();
config.Filters.Add(new OAuthAuthenticationFilter());// turns on aad b2c token validation
config.Filters.Add(new ErrorFilter());
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
Configure filter
In config
<appSettings>
<add key ="aadTenant" value="tenantName.onmicrosoft.com" />
<add key="audience" value="you appid" />
<add key="issuerHostName" value="https://login.microsoftonline.com/{your tenant id}/v2.0/" />
<add key ="aadPolicy" value="B2C_1A_SignIn" />
</appSettings>
In code
protected void Application_Start()
{
//Mandatory
B2CGlobalConfiguration.AadTenant="tenantName.onmicrosoft.com";
B2CGlobalConfiguration.Audience="you appid";
B2CGlobalConfiguration.ValidIssuer="https://login.microsoftonline.com/{your tenant id}/v2.0/";
//Optional
B2CGlobalConfiguration.AadPolicy="B2C_1A_SignIn"
//Regular app start stuff
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
asp.net core
add filter
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
.AddB2CAuthentication("OAuth2", "Azure B2C authentication");//Add the B2C authentication scheme
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.AddConfigurationManager(new ConfigManager());// Add the configuration binding. Implement your own manager to fit with your configuration scheme.
//the netcore version uses the same config keys as the .net framework version.
app.UseMvc();
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Framework | net471 is compatible. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.0
- Microsoft.AspNetCore (>= 2.0.1)
- Microsoft.AspNetCore.Authentication (>= 2.0.1)
- Microsoft.AspNetCore.Authentication.Abstractions (>= 2.0.1)
- Newtonsoft.Json (>= 10.0.3)
- Stardust.Aadb2c.AuthenticationFilter.Core (>= 1.0.0)
- Stardust.Particles (>= 4.0.2.1)
-
.NETFramework 4.7.1
- Microsoft.AspNet.WebApi.Client (>= 5.2.3)
- Microsoft.AspNet.WebApi.Core (>= 5.2.3)
- Newtonsoft.Json (>= 10.0.3)
- Stardust.Aadb2c.AuthenticationFilter.Core (>= 1.0.0)
- Stardust.Particles (>= 4.0.2.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Stardust.Aadb2c.AuthenticationFilter:
Package | Downloads |
---|---|
Stardust.Aadb2c.Swagger
Helper extensions to configure Swashbuckle Swagger and Swagger UI to use OAuth implicit grant with Azure AD b2c |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
2.5.1 | 1,171 | 4/9/2024 | |
2.5.0 | 4,299 | 3/5/2023 | |
2.4.0 | 2,996 | 1/4/2023 | |
2.3.3 | 2,709 | 7/8/2022 | |
2.3.2 | 877 | 7/8/2022 | |
2.2.3 | 10,195 | 10/7/2019 | |
2.2.2 | 2,475 | 7/3/2019 | |
2.2.0-rc1 | 901 | 5/21/2019 | |
2.0.5 | 2,756 | 11/6/2018 | |
2.0.4 | 2,506 | 10/2/2018 | |
2.0.3 | 1,760 | 6/26/2018 | |
2.0.2 | 1,482 | 5/29/2018 | |
2.0.1.2 | 1,395 | 4/4/2018 | |
2.0.1.1 | 1,413 | 4/4/2018 | |
2.0.0 | 1,475 | 3/6/2018 | |
2.0.0-pre0004 | 1,181 | 2/26/2018 | |
2.0.0-pre0003 | 1,103 | 2/26/2018 | |
2.0.0-pre0002 | 1,368 | 2/23/2018 | |
2.0.0-pre0001 | 1,283 | 2/23/2018 | |
1.2.1.5 | 1,353 | 10/23/2017 | |
1.2.1.3 | 1,211 | 10/23/2017 | |
1.2.1.2 | 1,289 | 10/23/2017 | |
1.2.1.1 | 1,187 | 10/19/2017 | |
1.2.1 | 1,214 | 10/19/2017 | |
1.2.0 | 1,254 | 10/17/2017 | |
1.1.5.8 | 1,304 | 10/17/2017 | |
1.1.5.7 | 1,446 | 10/4/2017 | |
1.1.5.6 | 1,304 | 10/4/2017 | |
1.1.5.5 | 1,252 | 10/2/2017 | |
1.1.5.2 | 1,313 | 8/15/2017 | |
1.1.5.1 | 1,305 | 8/15/2017 | |
1.1.5 | 1,222 | 8/15/2017 | |
1.1.4 | 1,226 | 8/15/2017 | |
1.1.3 | 1,272 | 8/15/2017 | |
1.1.2 | 1,286 | 8/15/2017 | |
1.1.1 | 1,143 | 8/7/2017 | |
1.1.0 | 1,324 | 7/11/2017 | |
1.0.0 | 4,117 | 7/5/2017 | |
1.0.0-pre2 | 1,228 | 7/5/2017 | |
1.0.0-pre1 | 1,274 | 7/4/2017 |
Updated to support .netcore