grant

package
v0.0.0-...-049ef2a Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TypeAuthorizationCode = "authorization_code"
View Source
const TypeClientCredentials = "client_credentials"
View Source
const TypeJWT = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
View Source
const TypePassword = "password"
View Source
const TypeRefreshToken = "refresh_token"

Variables

This section is empty.

Functions

This section is empty.

Types

type GrantHandler

type GrantHandler struct {
	Type string
	Func GrantHandlerFunc
}

func AuthorizationCode

func AuthorizationCode() *GrantHandler

func ClientCredentials

func ClientCredentials() *GrantHandler

func JWT

func JWT() *GrantHandler

func Password

func Password() *GrantHandler

func RefreshToken

func RefreshToken() *GrantHandler

type GrantHandlerFunc

type GrantHandlerFunc func(r *http.Request, c bridge.Client,
	sdi bridge.DataInterface, logger log.Logger, requestedTime time.Time) (*Response, *oer.OAuthError)

type Response

type Response struct {
	TokenType    string `json:"token_type"`
	AccessToken  string `json:"access_token"`
	ExpiresIn    int64  `json:"expires_in"`
	RefreshToken string `json:"refresh_token,omitempty"`
	Scope        string `json:"scope",omitempty`
	IdToken      string `json:"id_token,omitempty"`
}

func NewResponse

func NewResponse(token string, expiresIn int64) *Response

func (*Response) JSON

func (r *Response) JSON() []byte

Jump to

Keyboard shortcuts

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