oauth

package
v0.0.0-...-d8ceb07 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_COOKIE = "oauth_state"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides endpoints to allow this agent to be authorized.

func NewService

func NewService(clientID, clientSecret, callback string) *Service

func (*Service) PostAuth

func (s *Service) PostAuth(w http.ResponseWriter, r *http.Request)

PostAuth is the landing page where the user lads after authorizing. As above, you can do anything you want here. A common thing you might do is get the user information and then perform some sort of account linking in your database.

func (*Service) PreAuth

func (s *Service) PreAuth(w http.ResponseWriter, r *http.Request)

PreAuth is the landing page that the user arrives at when they first attempt to use the agent while unauthorized. You can do anything you want here, including making sure the user has an account on your side. At some point, you'll probably want to make a call to the authorize endpoint to authorize the app.

Jump to

Keyboard shortcuts

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