oauth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const OAuthStateLength = 64

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Log    *zap.Logger
	Graph  *ent.Client
	Config *oauth2.Config
}

Service provides HTTP handlers for the Auth service.

func (*Service) HTTP

func (svc *Service) HTTP(router *http.ServeMux)

HTTP registers http handlers for the Auth service.

func (Service) HandleLogin

func (svc Service) HandleLogin(w http.ResponseWriter, req *http.Request) error

HandleLogin creates an OAuth 2.0 code url and redirects the client.

func (Service) HandleOAuth

func (svc Service) HandleOAuth(w http.ResponseWriter, req *http.Request) error

HandleOAuth authorizes users after being redirected from the OAuth consent screen with an access code.

Jump to

Keyboard shortcuts

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