oauth2

package
v0.0.0-...-e28afbe Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthError

func AddAuthError(u *url.URL) *url.URL

func AddLoginError

func AddLoginError(u *url.URL) *url.URL

func FirstPartyOAuth2LoginRedirPath

func FirstPartyOAuth2LoginRedirPath(u *url.URL) (string, error)

Types

type Server

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

func NewServer

func NewServer(c *config.Config, scheme string, internalErrorHandler http.Handler, d *services.OAuth2, y *services.Crypto, k *web.Sessions) (s *Server, err error)

func (*Server) CreateProxyCredentials

func (o *Server) CreateProxyCredentials(ctx util.Context, userID string) (id string, err error)

func (*Server) HandleAccessTokenRequest

func (o *Server) HandleAccessTokenRequest(w http.ResponseWriter, r *http.Request)

func (*Server) HandleAuthorizationRequest

func (o *Server) HandleAuthorizationRequest(w http.ResponseWriter, r *http.Request)

func (*Server) RefreshProxyCredentialsIfNeeded

func (o *Server) RefreshProxyCredentialsIfNeeded(ctx util.Context, id, userID string) error

func (*Server) RemoveByAccess

func (o *Server) RemoveByAccess(ctx util.Context, t oauth2.TokenInfo) error

func (*Server) RemoveFirstPartyProxyAccessToken

func (o *Server) RemoveFirstPartyProxyAccessToken(w http.ResponseWriter, r *http.Request, ctx util.Context, sn *web.Session) error

func (*Server) Start

func (o *Server) Start()

func (*Server) Stop

func (o *Server) Stop()

func (*Server) Validate

func (o *Server) Validate(w http.ResponseWriter, r *http.Request) (userID string, auth bool, err error)

func (*Server) ValidateFirstPartyProxyAccessToken

func (o *Server) ValidateFirstPartyProxyAccessToken(ctx util.Context, sn *web.Session) (id, userID string, authenticated bool, err error)

func (*Server) ValidateOAuth2AccessToken

func (o *Server) ValidateOAuth2AccessToken(w http.ResponseWriter, r *http.Request) (token oauth2.TokenInfo, authenticated bool, err error)

Jump to

Keyboard shortcuts

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