Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

TodoApp

> 安全
Open source

Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication

3.1K stars0 likes2 views
WebsiteGitHub

About

Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication

Todo application with ASP.NET Core

This is a Todo application that features:

  • Todo.Web - An ASP.NET Core hosted Blazor WASM front end application
  • Todo.Api - An ASP.NET Core REST API backend using minimal APIs

It showcases:

  • Blazor WebAssembly
  • Minimal APIs
  • Using EntityFramework and SQLite for data access
  • OpenAPI
  • User management with ASP.NET Core Identity
  • Cookie authentication
  • Bearer authentication
  • Proxying requests from the front end application server using YARP's IHttpForwarder
  • Rate Limiting
  • Writing integration tests for your REST API

Prerequisites

  1. Install .NET 9
  2. Aspire CLI

Database

The application uses SQLite and entity framework. Aspire is used to bootstrap all dependencies.

Running the application

To run the application, run the TodoApp.AppHost project. This uses Aspire to run both the Todo.Web/Server and Todo.Api.

Optional

Using the API standalone

The Todo REST API can run standalone as well. You can run the Todo.Api project and make requests to various endpoints using the Swagger UI (or a client of your choice):

Before executing any requests, you need to create a user and get an auth token.

  1. To create a new user, run the application and POST a JSON payload to /users/register endpoint:

    json
    {
      "email": "[email protected]",
      "password": "<put a password here>"
    }
  2. To get a token for the above user, hit the /users/login endpoint with the above user email and password. The response will look like this:

    json
    {
      "tokenType": "Bearer",
      "accessToken": "string",
      "expiresIn": <seconds>,
      "refreshToken": "string"
    }
  3. You should be able to use the accessToken to make authenticated requests to the todo endpoints.

Social authentication

In addition to username and password, social authentication providers can be configured to work with this todo application. By default it supports Github, Google, and Microsoft accounts.

Instructions for setting up each of these providers can be found at:

  • Github
  • Microsoft
  • Google

Once you obtain the client id and client secret, the configuration for these providers must be added with the following schema:

json
{
    "Authentication": {
        "Schemes": {
            "<scheme>": {
                "ClientId": "xxx",
                "ClientSecret": "xxxx"
            }
        }
    }
}

Or using environment variables:

Authentication__Schemes__<scheme>__ClientId=xxx
Authentication__Schemes__<scheme>__ClientSecret=xxx

Or using user secrets:

dotnet user-secrets set Authentication:Schemes:<scheme>:ClientId xxx
dotnet user-secrets set Authentication:Schemes:<scheme>:ClientSecret xxx

Other providers can be found here. These must be added to AuthenticationExtensions as well.

NOTE: Don't store client secrets in configuration!

Auth0

This sample has Auth0 configured as an OIDC server. It can be configured with the following schema:

json
{
  "Authentication": {
    "Schemes": {
      "Auth0": {
        "Audience": "<audience>",
        "Domain": "<domain>",
        "ClientId": "<client id>",
        "ClientSecret": "<client secret>"
      }
    }
  }
}

Learn more about the Auth0 .NET SDK here.

OpenTelemetry

This app uses OpenTelemetry to collect logs, metrics and spans. You can see this using the Aspire Dashboard.

Issues· 5 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#aspnetcoreauthenticationblazorcookies

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.