Help us shape the future of Go! Take the 2026 Go Developer Survey

tokenendpoint

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tokenendpoint turns the errors of an OAuth token request (golang.org/x/oauth2) into errors of this module that carry none of the endpoint's free text. It sits apart from internal/dependency so that packages without OAuth do not import oauth2. Its functions are safe for concurrent use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(operation string, err error) error

Error returns "<operation>: token endpoint answered HTTP <status> [<OAuth error code>]" for an error answer of the endpoint (*oauth2.RetrieveError): its description, URI and body are the endpoint's free text and stay out of errors and outcomes (LOG-009). A failed call (*url.Error) or a cancelled or expired context goes through dependency.Error, so the context error stays detectable. Anything else is an answer oauth2 could not read (a malformed token response, whose parse error quotes its values): "<operation>: token endpoint answered an unreadable token response".

func Refused

func Refused(err error) bool

Refused reports whether err is an error answer of the endpoint below 500: the endpoint refused the request (an invalid code, verifier or client), as opposed to failing or not being reached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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