ASP.Net Core SAML authentication

This is probably basically an updated version of Anders Abel’s answer, but: I used https://github.com/Sustainsys/Saml2. They have a nuget package with 36k downloads called “Sustainsys.Saml2.AspNetCore2”. They have a helpful example .net core app using it that also uses .net core identity here: https://github.com/Sustainsys/Saml2/tree/master/Samples/SampleAspNetCore2ApplicationNETFramework (take a look at their startup.cs and also their external login razor … Read more

Is Kestrel using a single thread for processing requests like Node.js?

Updated for ASP.Net Core 2.0. As pointed by poke, the server has been split between hosting and transport, where libuv belongs to the transport layer. The libuv ThreadCount has been moved to its own LibuvTransportOptions and they are set separately in your web host builder with the UseLibuv() ext method: If you check the LibuvTransportOptions … Read more

Entity Framework Core: DbContextOptionsBuilder does not contain a definition for ‘usesqlserver’ and no extension method ‘usesqlserver’

First we install the Microsoft.EntityFrameworkCore.SqlServer NuGet Package: PM > Install-Package Microsoft.EntityFrameworkCore.SqlServer Then, after importing the namespace with using Microsoft.EntityFrameworkCore; we add the database context: services.AddDbContext<AspDbContext>(options => options.UseSqlServer(config.GetConnectionString(“optimumDB”)));

PayPal Transaction Search API: PERMISSION_DENIED, No Permission for the requested operation

You need the scope https://uri.paypal.com/services/reporting/search/read .. if it’s not there in the oauth2 response, double check your REST App’s permissions. Refreshing an access token Existing access tokens are cached for 9 hours–so if you already requested an API token and then just added this permission to your app, it can take up to 9 hours … Read more

.Net Core on Raspberry Pi 4 with Raspbian?

Download .Net Core 3.1 SDK from HERE Make Directory: sudo mkdir /usr/share/dotnet/ PATH to environment: export PATH=$PATH:/usr/share/dotnet/dotnet export DOTNET_ROOT=/usr/share/dotnet/dotnet or just a symlink sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet Copy by Extracting: sudo tar zxf dotnet-sdk-3.1.100-linux-arm.tar.gz -C /usr/share/dotnet/ Confirm Installation: dotnet –info you can find in detail from Here

OData Support in ASP.net core

Edit: now available at https://www.nuget.org/packages/Microsoft.OData.Core/ It’s in the road map, OData Lib has released 7.0.0 which is a breaking change release, OData/WebAPI will release 6.0.0 based on this, after the release, we will consider to support ASP.NET Core. Relative issue: https://github.com/OData/WebApi/issues/772

AddJwtBearer OnAuthenticationFailed return custom error

It’s important to note that both the aspnet-contrib OAuth2 validation and the MSFT JWT handler automatically return a WWW-Authenticate response header containing an error code/description when a 401 response is returned: If you think the standard behavior is not convenient enough, you can use the events model to manually handle the challenge. E.g: services.AddAuthentication() .AddJwtBearer(options … Read more

Remove “Server” header from ASP.NET Core 2.1 application

This solution works on IIS 10+ version and allows to remove x-powered-by and server headers in server response. In IIS 10 a new attribute was added: removeServerHeader. We need to create web.config file in asp.net core application with following content: <?xml version=”1.0″ encoding=”utf-8″?> <configuration> <system.webServer> <security> <requestFiltering removeServerHeader=”true” /> </security> <httpProtocol> <customHeaders> <remove name=”X-Powered-By” /> … Read more