oauth

package
v1.16.27 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Config                   *server.Config
	Manager                  oauth2.Manager
	ClientAuthorizedHandler  oauth3.ClientAuthorizedHandler
	ClientScopeHandler       oauth3.ClientScopeHandler
	UserAuthorizationHandler oauth3.UserAuthorizationHandler
	RefreshingScopeHandler   oauth3.RefreshingScopeHandler
	ResponseErrorHandler     oauth3.ResponseErrorHandler
	InternalErrorHandler     oauth3.InternalErrorHandler
	ExtensionFieldsHandler   oauth3.ExtensionFieldsHandler
}

func NewDefaultServer

func NewDefaultServer(manager oauth2.Manager) *Server

func NewServer

func NewServer(cfg *server.Config, manager oauth2.Manager) *Server

NewServer create authorization server

func (*Server) CheckGrantType

func (s *Server) CheckGrantType(gt oauth2.GrantType) bool

func (*Server) CheckResponseType

func (s *Server) CheckResponseType(rt oauth2.ResponseType) bool

func (*Server) GetAccessToken

func (s *Server) GetAccessToken(ctx context.Context, gt oauth2.GrantType, tgr *oauth2.TokenGenerateRequest) (oauth2.TokenInfo, error)

func (*Server) GetAuthorizeData

func (s *Server) GetAuthorizeData(rt oauth2.ResponseType, ti oauth2.TokenInfo) map[string]interface{}

func (*Server) GetAuthorizeToken

func (s *Server) GetAuthorizeToken(ctx context.Context, req *oauth.OauthReq) (ti oauth2.TokenInfo, err error)

func (*Server) GetErrorData

func (s *Server) GetErrorData(err error) (map[string]interface{}, int, http.Header)

func (*Server) GetRedirectURI

func (s *Server) GetRedirectURI(req *oauth.OauthReq, data map[string]interface{}) (uri string, err error)

func (*Server) GetTokenData

func (s *Server) GetTokenData(ti oauth2.TokenInfo) map[string]interface{}

func (*Server) HandleAuthorizeRequest

func (s *Server) HandleAuthorizeRequest(ctx context.Context, req *oauth.OauthReq, token string) (w *response.HttpResponse)

func (*Server) HandleTokenRequest

func (s *Server) HandleTokenRequest(ctx context.Context, r *oauth.OauthReq) (*response.HttpResponse, error)

func (*Server) ValidationAuthorizeRequest

func (s *Server) ValidationAuthorizeRequest(req *oauth.OauthReq) error

func (*Server) ValidationTokenRequest

func (s *Server) ValidationTokenRequest(r *oauth.OauthReq) (*oauth2.TokenGenerateRequest, error)

Jump to

Keyboard shortcuts

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