oauth2

package
v2.11.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpiresAt

func ExpiresAt(c ClaimsResolver) time.Time

ExpiresAt returns the result of calling the GetExpiresAt method on c, if c type contains an GetExpiresAt method returning time. Otherwise, ExpiresAt returns zero time.

func Scope

func Scope(c ClaimsResolver) []string

Scope returns the result of calling the GetScope method on c, if c type contains an GetScope method returning slice of strings. Otherwise, Scope returns empty slice.

Types

type ClaimsResolver

type ClaimsResolver interface {
	// New returns new instance pointer from the same type.
	New() ClaimsResolver
	// Verify the authorization response claims.
	Verify(claims.VerifyOptions) error
	// Resolve returns user info resolved from the authorization response claims.
	Resolve() auth.Info
}

ClaimsResolver provides context information about an authorization response.

type ErrorResolver

type ErrorResolver interface {
	error
	// New returns new instance pointer from the same type.
	New() ErrorResolver
}

ErrorResolver provides context information about an authorization error response.

type ResponseError

type ResponseError struct {
	// Reason is the error reason or code,
	// In RFC 6749 called error.
	Reason string `json:"error"`
	// URI identifying a human-readable web page with
	// information about the error.
	URI string `json:"error_uri"`
	// Description is a text providing additional information,
	// used to assist in understanding the error that occurred.
	Description string `json:"error_description"`
}

ResponseError implements ErrorResolver and provides context information about an authorization error response as defined in RFC 6749.

func (ResponseError) Error

func (e ResponseError) Error() string

func (ResponseError) New

func (e ResponseError) New() ErrorResolver

New returns new ResponseError as ErrorResolver.

Directories

Path Synopsis
Package introspection provide auth strategy to authenticate, incoming HTTP requests using the oauth2 token introspection endpoint, as defined in RFC 7662.
Package introspection provide auth strategy to authenticate, incoming HTTP requests using the oauth2 token introspection endpoint, as defined in RFC 7662.
Package jwt provides authentication strategy, incoming HTTP requests using the oauth2 jwt access token or openid IDToken.
Package jwt provides authentication strategy, incoming HTTP requests using the oauth2 jwt access token or openid IDToken.
Package userinfo provide auth strategy to authenticate, incoming HTTP requests using the oauth2/openid userinfo endpoint, as defined in OpenID Connect https://openid.net/specs/openid-connect-core-1_0.html#UserInfo.
Package userinfo provide auth strategy to authenticate, incoming HTTP requests using the oauth2/openid userinfo endpoint, as defined in OpenID Connect https://openid.net/specs/openid-connect-core-1_0.html#UserInfo.

Jump to

Keyboard shortcuts

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