ASP .NET
This article describes how to disable authentication for ASP.NET Core 2.0. ASP.NET Core JWT Authentication I have some Rest API which I want to protect via JwtBearer token in production e.g.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
public void ConfigureServices(IServiceCollection services) { ... services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }).AddJwtBearer(o => { o.Authority = authority; o.Audience = audience; o.RequireHttpsMetadata = false; }); services.AddMvc(); ... } public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { ... app.UseAuthentication(); app.UseMvc(); ... } |
However in order to test the API, for development I… mehr
This article demonstrates how the Hangfire dashboard can be set up in an ASP .NET 5 application including authentication via ASP .NET Identity. Adding Hangfire Packages project.json:
1 2 3 4 5 6 |
"dependencies": { ... "Hangfire.SqlServer": "1.5.3", "Hangfire": "1.5.3", ... }, |
Since I am using Hangfire with SQL, I have to add Hangfire itself and Hangfire.SqlServer… mehr
302 API Redirect Problem If you make a request to a REST service and are not logged in, by default ASP .NET 5 Identity returns a 302 Redirect to login page. This is great if you are visiting the URL of a controller… mehr
In this article I will demonstrate how to restrict controller access to users that have already logged in. In the second part I will show how to do authentication using a REST Controller. Access Restriction In order to restrict access to a Controller… mehr
In this article we will demonstrate how to provide authentication to ASP .NET 5 applications using ASP .NET Identity with Entity Framework 7. Adding Packages Add the following package to your ASP .NET project. This will automatically pull in additional required dependencies… mehr
With ASP .NET 5 MVC 6 you do not have to rely on external Dependency Injection (DI) libraries any more. It comes with it’s on onboard DI. I will now demonstrate how to set up Dependency Injection for using Entity Framework 7… mehr
Create Initial Code First Migration In order to do Code First Migrations, you first have to set up the command dnx ef. Code first means, that you first do database model changes in the Entity Framework database classes and then apply the changes to… mehr
In previous to 7 versions of the Entity Framework all Entity Framework related commands could be executed within Visual Studio. Now you have to use the new ASP .NET 5 dnx command instead. DbContext Model Migration from Entity Framework 6 In order… mehr
Adding Entity Framework 7 Packages to ASP .NET Project Older versions of the Entity Framework need a full .NET runtime in order to work. If at some point you want to use the new .NET 5 Core e.g. to run your application… mehr
During the Visual Studio installation include ASP .NET and the Microsoft Web Developer Tools Create a new ASP .NET 5 project using Visual Studio File -> New -> Project From the templates select ASP .NET Web Application In the next step select one… mehr