oauth

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package oauth implements an authentification backend based on OAuth. It allows for authenticating against an OAuth2 provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBackend

func NewBackend(db *database.Database, sessionsManager *sessions.Manager, oauthProvider Provider, serverURL *url.URL) auth.Backend

NewBackend returns a new oauth authentification backend

Types

type Provider

type Provider interface {
	Config() *oauth2.Config

	//UserInfo returns the user ID and username given an auth token
	UserInfo(token string) (uint, string, error)
}

Provider represents an oauth provider. It provides a config and a method to obtain user information from an access token.

func NewProvider

func NewProvider(provider string, baseURL *url.URL, clientID, clientSecret string) (Provider, error)

NewProvider creates a new OAuth Provider

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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