Documentation

Overview

    Package nonce implements

    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 *oidc.IDToken) error

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

                Source Files