oauth

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorEmptyParams liberr.CodeError = iota + liberr.MinPkgOAuth
	ErrorOAuthExchange
)

Variables

This section is empty.

Functions

func ConfigExchangeCode

func ConfigExchangeCode(oa *oauth2.Config, ctx context.Context, httpcli *http.Client, code string) (*http.Client, errors.Error)

func ConfigGetAuthCodeUrl

func ConfigGetAuthCodeUrl(oa *oauth2.Config, state string, online bool) string

ConfigGetAuthCodeUrl returns a URL to OAuth 2.0 provider's consent page that asks for permissions for the required scopes explicitly.

State is a token to protect the user from CSRF attacks. You must always provide a non-empty string and validate that it matches the the state query parameter on your redirect callback. See http://tools.ietf.org/html/rfc6749#section-10.12 for more info.

online may include true for AccessTypeOnline or false for AccessTypeOffline, as well as ApprovalForce.

func NewClientFromToken

func NewClientFromToken(ctx context.Context, httpcli *http.Client, tokenOAuth string) *http.Client

func NewClientFromTokenSource

func NewClientFromTokenSource(ctx context.Context, httpcli *http.Client, token oauth2.TokenSource) *http.Client

func NewConfigOAuth

func NewConfigOAuth(clientID, clientSecret, endpointToken, endpointAuth, redirectUrl string, scopes []string) *oauth2.Config

Types

This section is empty.

Jump to

Keyboard shortcuts

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