nonce

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package nonce implements helpers for OIDC nonce parameter handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidNonceError

type InvalidNonceError struct {
	Expected Nonce
	Got      Nonce
}

InvalidNonceError is returned by Validate when the observed nonce is invalid.

func (InvalidNonceError) Error

func (e InvalidNonceError) Error() string

type Nonce

type Nonce string

Nonce implements some utilities for working with OIDC nonce parameters.

func Generate

func Generate() (Nonce, error)

Generate generates a new random OIDC nonce parameter of an appropriate size.

func (*Nonce) Param

func (n *Nonce) Param() oauth2.AuthCodeOption

Param returns the OAuth2 auth code parameter for sending the nonce during the authorization request.

func (*Nonce) String

func (n *Nonce) String() string

String returns the string encoding of this state value.

func (*Nonce) Validate

func (n *Nonce) Validate(token *coreosoidc.IDToken) error

Validate the returned ID token). Returns true iff the nonce matches or the returned JWT does not have a nonce.

Jump to

Keyboard shortcuts

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