oauth

package
v6.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package oauth provides a small test harness for OAuth flows used by Claude Remote MCP connectors (DCR + PKCE + refresh).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeOptions

type AuthorizeOptions struct {
	// McpEndpoint is the protected MCP resource URL (the `/mcp` endpoint).
	McpEndpoint string
	// Origin is passed as the Origin header on the first MCP call.
	// Defaults to https://claude.ai.
	Origin string
	// RedirectURI must match the authorization server policy allowlist.
	RedirectURI string
}

type ClaudePublicClient

type ClaudePublicClient struct {
	// contains filtered or unexported fields
}

ClaudePublicClient is an OAuth test client that emulates Claude connector behavior.

func NewClaudePublicClient

func NewClaudePublicClient(httpClient *http.Client) *ClaudePublicClient

NewClaudePublicClient creates a client. If httpClient is nil, a default client is created that does not automatically follow redirects (required to capture authorization codes from Location headers).

func (*ClaudePublicClient) Authorize

Authorize performs: - 401 challenge parsing (WWW-Authenticate) - protected resource metadata fetch - AS metadata fetch - DCR - Authorization Code + PKCE - Token exchange + refresh

type DCRResult

type DCRResult struct {
	ClientID string
}

type Discovery

type Discovery struct {
	ResourceMetadataURL         string
	ProtectedResourceMetadata   *oauthruntime.ProtectedResourceMetadata
	AuthorizationServerMetadata *oauthruntime.AuthorizationServerMetadata
}

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL