oauth

package
v0.0.0-...-91f6600 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package oauth contains the oauth utilities for the platform

Index

Constants

View Source
const (
	//GOOGLE is google oauth agent string
	GOOGLE = "GOOGLE"
)

Variables

This section is empty.

Functions

func Info

func Info(ctx context.Context, appCtx *config.AppContext, agent Agent) (*config.UserInfo, error)

Info returns the userinfo of a given user from the oauth agent

Types

type Agent

type Agent interface {
	//Info returns the user info for a given app context
	Info(context.Context, *config.AppContext) (*config.UserInfo, error)
	//Name is the name of the auth agent
	Name() string
}

Agent is the oauth agent interface to be implmented. OAuth agents are google, facebook etc.

type UserInfoMap

type UserInfoMap struct {
	Email   string //Email key of the user info model
	Name    string //Name key of the user info model
	Picture string //Picture url key of the user info model
}

UserInfoMap contains the string of the keywords to be used to retrieve the user info from the api respose of the auth agent like Google, Facebook etc.

Directories

Path Synopsis
Package google has the implmentations for google oauth and google user profile fetch
Package google has the implmentations for google oauth and google user profile fetch

Jump to

Keyboard shortcuts

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