internal

package
v0.0.0-...-94a378c Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdpConfig

type IdpConfig struct {
	// contains filtered or unexported fields
}

IdpConfig represents the configuration for the google identity provider

func NewIdpConfig

func NewIdpConfig(apiKey, emulatorHost string) *IdpConfig

func (IdpConfig) Exchange

func (cfg IdpConfig) Exchange(
	ctx context.Context, accessToken *oauth2.Token) (*IdpUser, *oauth2.Token, error)

Exchange exchanges an OAuth2 Access Token for an IDP ID Token

func (IdpConfig) Refresh

func (cfg IdpConfig) Refresh(
	ctx context.Context, refreshToken *oauth2.Token) (*oauth2.Token, error)

Refresh gets a new IDP ID Token with the provided refresh token.

type IdpUser

type IdpUser struct {
	LocalID       string `json:"localId"`
	EmailVerified bool   `json:"emailVerified"`
	Email         string `json:"email"`
	DisplayName   string `json:"displayName"`
	PhotoURL      string `json:"photoUrl"`
	RefreshToken  string `json:"refreshToken"`
}

Jump to

Keyboard shortcuts

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