oidc

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 12 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func OidcClient

func OidcClient(cfg Config) (*Client, error)

Creates a new OIDC client with the given configuration.

func (*Client) CheckExpiration

func (c *Client) CheckExpiration(token string, leewaySeconds int64) error

CheckExpiration checks if the token is expired considering leeway.

func (*Client) DecodeClaims

func (c *Client) DecodeClaims(token string) (map[string]interface{}, error)

DecodeClaims decodes the JWT claims (payload).

func (*Client) Introspect

func (c *Client) Introspect(token string) (*IntrospectionResult, error)

Introspect performs token introspection and returns the result. (Client_ID and Client_Secret must be set in Config)

func (*Client) ValidateIssuer

func (c *Client) ValidateIssuer(token string) error

ValidateIssuer verifies that the token's issuer matches allowed patterns.

func (*Client) ValidateKID

func (c *Client) ValidateKID(token string) error

ValidateKID checks if the token's KID is present in the JWKS.

type Config

type Config struct {
	Issuers       []string // Can be a regexp pattern
	ClientID      string
	ClientSecret  string
	Timeout       time.Duration
	CacheTTL      time.Duration
	LeewaySeconds int64
}

type Endpoints

type Endpoints struct {
	Introspection string
	JWKS          string
}

type IntrospectionResult

type IntrospectionResult struct {
	Claims map[string]interface{}
	Scopes []string
}

Jump to

Keyboard shortcuts

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