pkce

package
v0.0.0-...-cdfb39b Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	*oauth2.Config
	ProfileURL string
	// contains filtered or unexported fields
}

func New

func New(clientID, redirectURI, domain string, scopes ...string) *Provider

func (*Provider) BeginAuth

func (p *Provider) BeginAuth(state string) (goth.Session, error)

func (*Provider) Debug

func (p *Provider) Debug(_ bool)

func (*Provider) FetchUser

func (p *Provider) FetchUser(session goth.Session) (goth.User, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) RefreshToken

func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error)

func (*Provider) RefreshTokenAvailable

func (p *Provider) RefreshTokenAvailable() bool

func (*Provider) SetName

func (p *Provider) SetName(name string)

func (*Provider) UnmarshalSession

func (p *Provider) UnmarshalSession(data string) (goth.Session, error)

type Session

type Session struct {
	AuthURL      string
	AccessToken  string
	RefreshToken string
	ExpiresAt    time.Time
	CodeVerifier string
}

func (*Session) Authorize

func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error)

Authorize should validate the data from the provider and return an access token that can be stored for later access to the provider.

func (*Session) GetAuthURL

func (s *Session) GetAuthURL() (string, error)

GetAuthURL returns the URL for the authentication end-point for the provider.

func (*Session) Marshal

func (s *Session) Marshal() string

Marshal generates a string representation of the Session for storing between requests.

type UserInfo

type UserInfo struct {
	Email    string `json:"email"`
	Name     string `json:"name"`
	NickName string `json:"nickname"`
	UserID   string `json:"sub"`
}

Jump to

Keyboard shortcuts

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