Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Web Development with Blazor
  • Table Of Contents Toc
Web Development with Blazor

Web Development with Blazor - Fourth Edition

By : Jimmy Engström
close
close
Web Development with Blazor

Web Development with Blazor

By: Jimmy Engström

Overview of this book

Blazor has grown, and with that growth comes a simple question: How should we build Blazor apps today? This book answers that question by building a real application step by step. We start with what Blazor is, why it is not just WebAssembly, and how the different hosting models fit together. From there, we create components, manage state, build forms with validation, add APIs, secure the app with authentication and authorization, use JavaScript when it makes sense, and test our components with bUnit. We also look at the key aspects of modern Blazor development, including render modes, server-side rendering, WebAssembly, Aspire, OpenTelemetry, debugging, deployment, and how to work with existing sites when starting from scratch is not an option. The goal is not only to copy code but also to understand why we choose one approach over another. Should this be SSR, Server, WebAssembly, or Auto? Where should interactivity live? What changes when the code runs in the browser? We answer those questions without making things more complicated than they need to be. Whether you're new to Blazor or upgrading from an earlier edition, the fourth edition brings the book up to date with .NET 10, Aspire, tracing, metrics, testing, and modern Blazor app development. Own a raccoon cover already? The collection must continue. The raccoons insist.
Table of Contents (30 chapters)
close
close
Lock Free Chapter
1
Part 1: Getting Started with Blazor
6
Part 2: Building a Blazor Application
16
Part 3: Running Blazor with Confidence
21
Part 4: Going Beyond the Main Application
28
Other Books You May Enjoy
29
Index

Setting up authentication

There are many built-in features for authentication. The easiest way to add authentication is to select an authentication option when creating a project. However, we can also add authentication later by scaffolding it if we want to.

When using the Blazor Web App Template, the server handles all the authentication. The client doesn't have to know anything about the authentication provider.

Setting up Auth0

First, we need to set up Auth0.

Auth0 is a service that can help us with handling authentication for our users. There are many different services like this, but Auth0 is a good fit for us. We can connect one or more social connectors, which will allow our users to log in with Facebook, X, Twitch, or whatever we add to our site.

Even though all of this can be achieved by writing code ourselves, an integration like this is a great way to add authentication quickly, and it also provides a very powerful solution. Also, authentication is complex, so don&apos...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Web Development with Blazor
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon