auth

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCode

func GetCode(r *http.Request) (code string, err error)

func LoginURL

func LoginURL(endpoint Endpoint, config Config) string

func LogoutURL

func LogoutURL(endpoint Endpoint, postLogoutRedirectURI string) string

Types

type Config

type Config struct {
	ClientID    string
	Scopes      []string
	RedirectURI string
}

type Endpoint

type Endpoint struct {
	Authorization string
	Token         string
	Logout        string
}

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	ExpiresAt   int64  `json:"expires_at"`

	RefreshToken string `json:"refresh_token"`
}

func RedeemCode

func RedeemCode(code string, endpoint Endpoint, config Config) (tokens Token, err error)

func Refresh

func Refresh(refreshToken string, endpoint Endpoint, config Config) (tokens Token, err error)

func (Token) Expired added in v0.1.3

func (token Token) Expired() bool

Jump to

Keyboard shortcuts

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