socialAuth

package
v0.0.0-...-6f1d728 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(ctx context.Context, code string) (string, error)

func GetEmail

func GetEmail(ctx context.Context, accessToken string) (string, error)

func GetUserInfoFacebook

func GetUserInfoFacebook(state string, code string) ([]byte, error)

func GetUserInfoGoogle

func GetUserInfoGoogle(state string, code string) ([]byte, error)

func HTTPClient

func HTTPClient() *http.Client

func HandleFacebookCallback

func HandleFacebookCallback(w http.ResponseWriter, r *http.Request)

func HandleFacebookLogin

func HandleFacebookLogin(w http.ResponseWriter, r *http.Request)

func HandleGHCallback

func HandleGHCallback(w http.ResponseWriter, r *http.Request)

func HandleGHLogin

func HandleGHLogin(w http.ResponseWriter, r *http.Request)

func HandleGoogleCallback

func HandleGoogleCallback(w http.ResponseWriter, r *http.Request)

func HandleGoogleLogin

func HandleGoogleLogin(w http.ResponseWriter, r *http.Request)

Types

type FBUser

type FBUser struct {
	FBName string `json:"first_name"`
	Email  string `json:"email"`
}

type GithubUser

type GithubUser struct {
	Login  string `json:"login"`
	NodeID string `json:"node_id"`
	GHName string `json:"name"`
	Email  string `json:"email"`
}

func GetOauthUser

func GetOauthUser(ctx context.Context, accessToken string) (*GithubUser, error)

func GetUserInfoGH

func GetUserInfoGH(state string, code string) (*GithubUser, error)

type GoogleUser

type GoogleUser struct {
	ID            string `json:"id"`
	Email         string `json:"email"`
	VerifiedEmail bool   `json:"verified_email"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Picture       string `json:"picture"`
	Locale        string `json:"locale"`
}

Jump to

Keyboard shortcuts

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