oauth

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//FacebookProvider is const for 'facebook'
	FacebookProvider = "facebook"
	//GoogleProvider is const for 'google'
	GoogleProvider = "google"
	//GitHubProvider is const for 'github'
	GitHubProvider = "github"
)

Variables

View Source
var ErrUserIDRequired = errors.New("UserID is required during OAuth integration")

ErrUserIDRequired is used when OAuth integration returns an empty user ID

Functions

This section is empty.

Types

type ProviderOption added in v0.15.0

type ProviderOption struct {
	Provider         string `json:"provider"`
	DisplayName      string `json:"displayName"`
	ClientID         string `json:"clientID"`
	URL              string `json:"url"`
	CallbackURL      string `json:"callbackURL"`
	LogoID           int    `json:"logoID"`
	IsCustomProvider bool   `json:"isCustomProvider"`
	IsEnabled        bool   `json:"isEnabled"`
}

ProviderOption represents an OAuth provider that can be used to authenticate

type Service

type Service interface {
	GetAuthURL(provider, redirect, identifier string) (string, error)
	GetProfile(provider string, code string) (*UserProfile, error)
	GetRawProfile(provider string, code string) (string, error)
	ParseRawProfile(provider, body string) (*UserProfile, error)
	ListActiveProviders() ([]*ProviderOption, error)
	ListAllProviders() ([]*ProviderOption, error)
}

Service provides OAuth operations

type UserProfile

type UserProfile struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

UserProfile represents an OAuth user profile

Jump to

Keyboard shortcuts

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