oauth

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: MIT Imports: 13 Imported by: 0

README

go-social

Social Login Implementation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID       string
	ClientSecret   string
	ApplicationKey string
	State          string
	RedirectURI    string
	// contains filtered or unexported fields
}

func Driver

func Driver(d *SocialDriver) *Config

func (*Config) GetAuthorizationUrl

func (c *Config) GetAuthorizationUrl() string

func (*Config) GetToken

func (c *Config) GetToken(vars url.Values) (interface{}, error)

func (*Config) GetUserInfo

func (c *Config) GetUserInfo(tokenSource interface{}) (map[string]interface{}, error)

func (*Config) SetAdditionalScope

func (c *Config) SetAdditionalScope(scopes []string) *Config

func (*Config) SetApplicationKey

func (c *Config) SetApplicationKey(applicationKey string) *Config

func (*Config) SetCredentials

func (c *Config) SetCredentials(clientId, clientSecret string) *Config

func (*Config) SetRedirectUrl

func (c *Config) SetRedirectUrl(xhost string) *Config

func (*Config) SetState

func (c *Config) SetState(state string) *Config

func (*Config) SetTokenAuthType

func (c *Config) SetTokenAuthType(authType string) *Config

type SocialDriver

type SocialDriver struct {
	Name                     *string           `bson:"Name"`
	OAuthVersion             string            `bson:"OAuthVersion`
	Scope                    []string          `bson:"Scope"`
	AuthExtras               map[string]string `bson:"AuthExtras`
	RequestTokenEndpoint     *string           `bson:"RequestTokenEndpoint`
	AuthorizationEndpoint    *string           `bson:"AuthorizationEndpoint`
	AuthorizationExtra       map[string]string `bson:"AuthorizationExtra`
	TokenEndpoint            *string           `bson:"TokenEndpoint`
	TokenAuthType            *string           `bson:"TokenAuthType`
	TokenExtraQueryString    map[string]string `bson:"TokenExtraQueryString`
	UserInfoMethod           *string           `bson:"UserInfoMethod`
	UserInfoEndpoint         string            `bson:"UserInfoEndpoint`
	UserInfoQueryString      map[string]string `bson:"UserInfoQueryString`
	UserInfoHeader           map[string]string `bson:"UserInfoHeader`
	UserInfoPayload          map[string]string `bson:"UserInfoPayload`
	UserInfoExtraMethod      *string           `bson:"UserInfoExtraMethod`
	UserInfoExtraEndpoint    *string           `bson:"UserInfoExtraEndpoint`
	UserInfoExtraQueryString map[string]string `bson:"UserInfoExtraQueryString`
	UserInfoExtraHeader      map[string]string `bson:"UserInfoExtraHeader`
	UserInfoExtraPayload     map[string]string `bson:"UserInfoExtraPayload`
	Mapping                  map[string]string `bson:"Mapping`
}

type User

type User struct {
	ID        string
	Email     string
	FullName  string
	FirstName string
	LastName  string
	Avatar    string
	Raw       interface{}
}

func (*User) AssignMap

func (u *User) AssignMap(mapping map[string]string, data map[string]interface{})

Directories

Path Synopsis
internal
oauth2
Package oauth2 provides support for making OAuth2 authorized and authenticated HTTP requests, as specified in RFC 6749.
Package oauth2 provides support for making OAuth2 authorized and authenticated HTTP requests, as specified in RFC 6749.
oauth2/clientcredentials
Package clientcredentials implements the OAuth2.0 "client credentials" token flow, also known as the "two-legged OAuth 2.0".
Package clientcredentials implements the OAuth2.0 "client credentials" token flow, also known as the "two-legged OAuth 2.0".
oauth2/endpoints
Package endpoints provides constants for using OAuth2 to access various services.
Package endpoints provides constants for using OAuth2 to access various services.
oauth2/jws
Package jws provides a partial implementation of JSON Web Signature encoding and decoding.
Package jws provides a partial implementation of JSON Web Signature encoding and decoding.
oauth2/jwt
Package jwt implements the OAuth 2.0 JSON Web Token flow, commonly known as "two-legged OAuth 2.0".
Package jwt implements the OAuth 2.0 JSON Web Token flow, commonly known as "two-legged OAuth 2.0".

Jump to

Keyboard shortcuts

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