oidc

package
v0.0.0-...-275021d Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ClientID     string
	ClientSecret string
	RedirectURI  string

	Verifier *oidc.IDTokenVerifier
	Provider *oidc.Provider

	// Does the provider use "offline_access" scope to request a refresh token
	// or does it use "access_type=offline" (e.g. Google)?
	OfflineAsScope bool

	Client *http.Client
}

App comment lint rebel

func Setup

func Setup(clientID, issuer, redirectURI string) (a App, err error)

Setup comment lint rebel

func (*App) Exchange

func (a *App) Exchange(code string) (token *oauth2.Token, err error)

Exchange comment lint rebel

func (*App) FetchCode

func (a *App) FetchCode()

FetchCode comment lint rebel

func (*App) GetContext

func (a *App) GetContext() context.Context

GetContext comment lint rebel

func (*App) GetLoginURL

func (a *App) GetLoginURL() string

GetLoginURL comment lint rebel

func (*App) GetToken

func (a *App) GetToken(refreshToken string) (token *oauth2.Token, err error)

GetToken comment lint rebel

func (*App) GetVerifier

func (a *App) GetVerifier() *oidc.IDTokenVerifier

GetVerifier comment lint rebel

func (*App) NewProvider

func (a *App) NewProvider(issuer string) (err error)

NewProvider comment lint rebel

func (*App) Oauth2Config

func (a *App) Oauth2Config(scopes []string) *oauth2.Config

Oauth2Config comment lint rebel

type Claims

type Claims struct {
	Issuer           string `json:"iss"`
	Subject          string `json:"sub"`
	Expiry           int64  `json:"exp"`
	IssuedAt         int64  `json:"iat"`
	AuthorizingParty string `json:"azp,omitempty"`
	Nonce            string `json:"nonce,omitempty"`

	AccessTokenHash string `json:"at_hash,omitempty"`
	CodeHash        string `json:"c_hash,omitempty"`

	Email         string `json:"email,omitempty"`
	EmailVerified *bool  `json:"email_verified,omitempty"`

	Groups []string `json:"groups,omitempty"`

	Name              string `json:"name,omitempty"`
	PreferredUsername string `json:"preferred_username,omitempty"`

	FederatedIDClaims *federatedIDClaims `json:"federated_claims,omitempty"`
}

Claims comment lint rebel

type CodeFetcher

type CodeFetcher interface {
	Fetch(a *App) (code string)
}

CodeFetcher comment lint rebel

Jump to

Keyboard shortcuts

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