static

package
v0.0.0-...-36f99de Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

package static uses golang.org/x/oauth2 to implement a Provider for the OAuth2 flow with a static config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth2

type OAuth2 struct {
	Config             *oauth2.Config
	UserInfoEndpoint   string
	EndSessionEndpoint string
	HTTPClient         *http.Client // will use http.DefaultClient if let nil
}

OAuth2 implements a Provider for the OAuth2 flow.

func (*OAuth2) AuthCodeURL

func (o *OAuth2) AuthCodeURL(state string) (string, string, error)

AuthCodeURL returns the Auth-URL to redirect the user to

func (*OAuth2) EndSessionURL

func (o *OAuth2) EndSessionURL() (*url.URL, error)

func (*OAuth2) Exchange

func (o *OAuth2) Exchange(code, verifier string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)

Exchange exchanges the code and provides a way to unmarshal the user info

func (*OAuth2) Refresh

func (o *OAuth2) Refresh(refreshToken string) (token *oauth2.Token, unmarshalUser func(interface{}) error, err error)

func (*OAuth2) SetRedirectURL

func (o *OAuth2) SetRedirectURL(url string)

SetRedirectURL sets the local callback URL.

Jump to

Keyboard shortcuts

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