oidc

package
v2.1.0 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: 0

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