auth

package
v1.0.0-...-04aeef2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Id           string
	Secret       string
	OAuthHost    string
	Host         string
	RandomString string
	Login        HandleConf
	Logout       HandleConf
	Callback     HandleConf
}

Basic configuration for an Auth

func (*Config) OAuth

func (c *Config) OAuth(root *gin.RouterGroup) *oauth2.Config

OAuth return the oauth2 configuration struct

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is e struct that eases Github OAuth and resource handling

func NewEngine

func NewEngine(conf Config, root *gin.RouterGroup) *Engine

NewEngine creates a new Engine using and adds the handle for authentication

func (*Engine) GetUser

func (e *Engine) GetUser(c *gin.Context) *models.User

GetUser returns the user connected

type HandleConf

type HandleConf struct {
	Endpoint string
	Redirect string
}

HandleConf contains info about and Handler

Jump to

Keyboard shortcuts

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