Create Certificates for IdentityServer4 signing using .NET Core

Nice article

Software Engineering

This article shows how to create certificates for an IdentityServer4 application to use for signing and token validation. The certificates are created using the CertificateManager nuget package. Both RSA and ECDsa certificates can be used for signing in IdentityServer4.

Code:Certificates for IdentityServer4 signing using .NET Core

Creating the Certificates in .NET Core

A simple .NET Core console application is used to create the certificates. This type of application can run on most of the standard operating systems. Create a new console application and add the package CertificateManager. The package Microsoft.Extensions.DependencyInjection is also required to initialize the package.

Creating a RSA certificate

A self signed RSA certificate can be created using the CertificateManager NewRsaSelfSignedCertificate method. The key size must be at least 2048. The following example also adds TLS server and client authentication OID extensions, so that the certificate could also be used for client authentication.

Creating a…

View original post 172 more words

Globally Require Authenticated Users By Default Using Fallback Policies in ASP.NET Core

Nice article

Scott Sauber

tldr;

You can use Fallback Policies in ASP.NET Core 3.0+ to require an Authenticated User by default. Conceptually, you can think of this as adding an [Authorize] attribute by default to every single Controller and Razor Page ONLY WHEN no other attribute is specified on a Controller or Razor Page (like [AllowAnonymous] or [Authorize(PolicyName="PolicyName")]).  See lines 9-11 below.



This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters


publicclassStartup
{
// Other Startup code omitted
publicvoidConfigureServices(IServiceCollectionservices)
{
services.AddAuthorization(options =>
{
options.FallbackPolicy =new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.Build();
// Register other policies here
});
// Other service…

View original post 1,218 more words

Requiring MFA for Admin Pages in an ASP.NET Core Identity application

Nice article from Damien.

Software Engineering

This article shows how MFA could be forced on users to access sensitive pages within an ASP.NET Core Identity application. This could be useful for applications where different levels of access exist for the different identities. For example, users might be able to view the profile data using a password login, but an administrator would be required to use MFA to access the admin pages.

Code: https://github.com/damienbod/AspNetCoreHybridFlowWithApi

Blogs in this series

Extending the Login with a MFA claim

The application is setup using ASP.NET Core with Identity and Razor Pages. In this demo, the SQL Server was replaced with SQLite, and the nuget packages were updated. The AddIdentity method is used instead of AddDefaultIdentity one, so…

View original post 344 more words

Adding external authentication with a Microsoft account

Very nice article: Adding external authentication with a Microsoft account

Sam Learns Azure

Today, we are going to add external authentication to our website, enabling us to restrict some features to logged in users. As we don’t want to manage users and passwords ourselves, we will utilize other authentication services, such as Microsoft Live/Account, Google, Twitter, and Facebook. Today, we will setup the infrastructure and connect to the Microsoft account, and then next week, show how to connect to Google, Twitter and Facebook too.

Upgrading to .Net Core 2.2

Before we start to add the authentication code, we are quickly going to upgrade to .Net Core 2.2, from 2.1. This was surprisingly easy for us – perhaps because of our automated testing. We didn’t have to update any code, except for the compatibility line in startup.cs in our web service and web site. This also gave us an opportunity to upgrade all of the NuGet packages to their latest versions. The automated tests…

View original post 1,132 more words

HDC 2019 – HTTP Security Headers

A nice document on HTTP Security headers by Scott Sauber.

Scott Sauber

Note: Slides do not tell the whole story of the talk, so take the stand alone slides with a grain of salt. Things may be taken out of context.

Slides: PPTX or PDF

View original post

Baby Monitor Chrome Extension – Streaming from Raspberry PI using SignalR and Cognitive Vision Service

SignalR Streaming is a latest addition to SignalR library and it supports sending fragments of data to clients as soon as it becomes available instead of waiting for all the data to become available. In this article, we will build a small app for baby monitoring to stream camera content from Raspberry PI using SignalR streaming. This tool … Continue reading Baby Monitor Chrome Extension – Streaming from Raspberry PI using SignalR and Cognitive Vision Service

Angular 7 CRUD With ASP.NET Core: Step by step guide

It feels great to be back with this, my 18th article on Angular with the recently updated Angular 7. With this article, let's try to explore the Angular 7 features and get hands on with the CRUD operations using Angular 7, .NET Core, and Entity Framework Core. Let us first set the agenda for this … Continue reading Angular 7 CRUD With ASP.NET Core: Step by step guide

Guest Post program: Welcoming recently joined authors

From September 2018, I have opened the gates for the guests to publish their articles on my site and I am glad to announce that 4 authors have been joined till now. If you are also interested to be a guest author then have a look here. This post is to welcome all the authors … Continue reading Guest Post program: Welcoming recently joined authors

Publish Angular 6 App To Firebase

Introduction We are going to learn to publish an Angular app using Firebase by following these steps. Publishing the site using Firebase is pretty easy. There are so many ways to publish our Angular app but Firebase makes it very simple and much faster to publish. Why we choose Firebase Firebase is a mobile and … Continue reading Publish Angular 6 App To Firebase

ChatBot With Azure Authentication – Part One

BotApp | AuthenticationWebApp Highlights of the article series How to register an app with Azure Active Directory? How to get the access token using Azure Active Directory authentication? How to register a bot application with Azure Bot Service? How to user Bot State Service to save user conversation state data such as access token? Prerequisites … Continue reading ChatBot With Azure Authentication – Part One