Auth0 Token Forwarding to Backend APIs

Community

Forward Auth0 access tokens to backend APIs

Authormpaulosky
Version1.0.0
Installs0

System Documentation

What problem does it solve?

When a frontend authenticated with Auth0 OIDC makes HttpClient calls to protected backend APIs, the user's access_token is not automatically propagated which causes 401 Unauthorized errors; this skill shows how to attach the token from the user's authentication session to outgoing requests.

Core Features & Use Cases

  • Automatic token attachment: Use a DelegatingHandler to read the access_token from the current HttpContext and set Authorization: Bearer {token} on outgoing HttpClient requests.
  • Framework scope: Designed for Blazor Server and ASP.NET Core frontends calling separate backend APIs that validate JWT bearer tokens.
  • Operational guidance: Covers registration of IHttpContextAccessor, enabling SaveTokens in OIDC options, handler registration on HttpClient, testing patterns, and common pitfalls.

Quick Start

Create a TokenForwardingHandler, register IHttpContextAccessor, set SaveTokens = true in your Auth0 OIDC options, and add the handler to each HttpClient registration so outgoing requests include the Bearer token.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: Auth0 Token Forwarding to Backend APIs
Download link: https://github.com/mpaulosky/dotfiles/archive/main.zip#auth0-token-forwarding-to-backend-apis

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.