Utility to extract OAuth2 tokens from headers or query strings
// Source: https://github.com/DuendeSoftware/foss | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using Microsoft.AspNetCore.Http;
using Microsoft.Net.Http.Headers;
namespace Duende.AspNetCore.Authentication.OAuth2Introspection.Infrastructure;
/// <summary>
/// Defines some common token retrieval strategies
/// </summary>
public static class TokenRetrieval
{
/// <summary>
/// Reads the token from the authorization header.
/// </summary>
/// <param name="scheme">The scheme (defaults to Bearer).</param>
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key