oidcresolver

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaimNames added in v0.22.13

type ClaimNames struct {
	Name              string
	Email             string
	Picture           string
	PreferredUsername string
}

ClaimNames maps profile fields onto the claims that carry them. Applies to both sources, so a provider using non-standard names is configured the same way regardless of where claims are read from.

func DefaultClaimNames added in v0.22.13

func DefaultClaimNames() ClaimNames

DefaultClaimNames are the standard OIDC claim names.

type Option added in v0.22.13

type Option func(*Resolver)

Option customizes how a Resolver obtains profile claims.

func WithClaimNames added in v0.22.13

func WithClaimNames(names ClaimNames) Option

WithClaimNames overrides the claim names. Empty fields keep their defaults.

func WithProfileSource added in v0.22.13

func WithProfileSource(source ProfileSource) Option

WithProfileSource selects the claim source. Defaults to ProfileSourceUserInfo.

type ProfileSource added in v0.22.13

type ProfileSource string

ProfileSource selects where provisioning-time profile claims are read from.

const (
	// ProfileSourceUserInfo fetches claims from the IdP's UserInfo endpoint.
	ProfileSourceUserInfo ProfileSource = "userinfo"
	// ProfileSourceToken reads claims from the validated access token itself.
	// Required for IdPs that issue audience-restricted access tokens: the OIDC
	// UserInfo endpoint rejects any token carrying an `aud` claim, so a Gateway
	// that needs a verifiable JWT cannot also call UserInfo with it.
	ProfileSourceToken ProfileSource = "token"
)

type Resolver

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

func NewResolver

func NewResolver(verifier *oidcauth.Verifier, usersClient usersv1.UsersServiceClient, httpClient *http.Client, opts ...Option) (*Resolver, error)

func (*Resolver) ResolveFromToken

func (r *Resolver) ResolveFromToken(ctx context.Context, accessToken string) (identity.ResolvedIdentity, error)

Jump to

Keyboard shortcuts

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