Archived Project with includes 2 factor auth for Razor Pages, using .NET 3.1. Advised to use the 5.0 version of the tutorial.
Here is a set-by-step guide without much of the explanations (but you should probably look out for changes in the v5.0 docs)