oauth2

package
v0.0.0-...-732a6c7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2018 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 OAuth2

type OAuth2 interface {
	GetAuthURL(scope, accessType, state, includeGrantedScopes, loginHint, prompt string) (string, error)
	GetToken(code string) ([]byte, error)
	VerifyToken(accessToken string) (string, error)
	RefreshToken(refreshToken string) (string, error)
	RevokeToken(accessToken string) error
	GetProfileDetails(accessToken string) (ProfileDetails, error)
	GetAndVerifyToken(code string) (VerifyDetails, error)
}

OAuth2 interface to deal with OAuth2

func NewOAuth2

func NewOAuth2(clientID, clientSecret, redirectURL string) (OAuth2, error)

NewOAuth2 - get a new client for OAuth2

type ProfileDetails

type ProfileDetails struct {
	Email  string
	Name   string
	Image  string
	ID     string
	Gender string
}

ProfileDetails stores the details fetched from the profile call

type VerifyDetails

type VerifyDetails struct {
	AccessToken  string
	TokenType    string
	ExpiresIn    int64
	RefreshToken string
	IDToken      string
	UserID       string
}

VerifyDetails stores the details for verifing an account

Jump to

Keyboard shortcuts

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