Help us shape the future of Go! Take the 2026 Go Developer Survey

oidcdiscovery

package
v1.149.0 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: 7 Imported by: 0

Documentation

Overview

Package oidcdiscovery fetches and parses an OpenID Connect provider's discovery document (<issuer>/.well-known/openid-configuration, per OpenID Connect Discovery 1.0 / RFC 8414).

It is a dependency-root leaf so both pkg/auth (which needs jwks_uri for JWKS validation) and pkg/oauth (which needs authorization_endpoint/token_endpoint for the brokered login flow) can share ONE fetch/parse implementation rather than each carrying its own copy that could drift.

Index

Constants

View Source
const WellKnownPath = "/.well-known/openid-configuration"

WellKnownPath is the discovery path appended to an issuer URL.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Issuer                string `json:"issuer"`
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	TokenEndpoint         string `json:"token_endpoint"`
	JWKSURI               string `json:"jwks_uri"`
}

Document is the subset of an OIDC provider's discovery metadata the platform consumes. Fields absent from the provider's document decode to the empty string; callers validate the ones they require.

func Fetch

func Fetch(ctx context.Context, client *http.Client, issuer string) (*Document, error)

Fetch retrieves and parses <issuer>/.well-known/openid-configuration using the provided HTTP client. It returns an error on a non-200 response or an undecodable body; it does NOT validate that any particular endpoint is present, leaving that to the caller.

Jump to

Keyboard shortcuts

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