internal

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package internal contains utilities for parsing OAuth2 tokens

Package internal includes functions to support OAuth/OIDC

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAccessTokenResponse

func ParseAccessTokenResponse(tokenResp *http.Response) (token *oauth2.Token, err error)

ParseAccessTokenResponse parses an RFC6749 access token response and returns either an `*oauth2.Token` on success, an `*ErrorTokenResponse` on failure, or any other error if the response cannot be parsed. See: https://datatracker.ietf.org/doc/html/rfc6749#section-5

Types

type ErrorTokenResponse

type ErrorTokenResponse struct {
	Code        string `json:"error"`
	Description string `json:"error_description,omitempty"`
	URI         string `json:"error_uri,omitempty"`
}

ErrorTokenResponse represents an RFC6749 access token error response. See: https://datatracker.ietf.org/doc/html/rfc6749#section-5.2

func (*ErrorTokenResponse) Error

func (e *ErrorTokenResponse) Error() string

Error implements `error`

Jump to

Keyboard shortcuts

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