verifier

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 6 Imported by: 0

README

okta-jwt-verifier

Test GoDoc Go Report

Alternative implementation to the official okta-jwt-verifier that includes support for telemetry (ie. OpenTelemetry), minimizing operational latency, and testability.

Examples

Access Token Validation
import (
    "context"
    verifier "github.com/sovietaced/okta-jwt-verifier"
)

func main() {
    ctx := context.Background()
    issuer := "https://test.okta.com"
    clientId := "test"
    v := verifier.NewVerifier(issuer, clientId)

    idToken := "..."
    token, err := v.VerifyAccessToken(ctx, idToken)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option for the Verifier

func WithKeyfuncProvider

func WithKeyfuncProvider(keyfuncProvider keyfunc.Provider) Option

WithKeyfuncProvider allows for a configurable keyfunc.Provider, which may be useful if you want to customize the behavior of how metadata or JWK sets are fetched.

type Options

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

Options are configurable options for the Verifier.

type Verifier

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

Verifier is the implementation of the Okta JWT verification logic.

func NewVerifier

func NewVerifier(issuer string, clientId string, options ...Option) *Verifier

NewVerifier creates a new Verifier for the specified issuer or client ID.

func (*Verifier) VerifyAccessToken added in v0.1.1

func (v *Verifier) VerifyAccessToken(ctx context.Context, accessToken string) (*jwt.Token, error)

VerifyAccessToken verifies an Okta access token.

func (*Verifier) VerifyIdToken

func (v *Verifier) VerifyIdToken(ctx context.Context, idToken string) (*jwt.Token, error)

VerifyIdToken verifies an Okta ID token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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