token

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	ClientId     string `json:"client_id"`
	RedirectUri  string `json:"redirect_uri"`
	Scope        string `json:"scope"`
	GrantType    string `json:"grant_type"`
	Code         string `json:"code"`
	CodeVerifier string `json:"code_verifier"`
	RefreshToken string `json:"refresh_token"`
}

func (*Params) FillRequest

func (p *Params) FillRequest(req *Request) (err error)

FillRequest transfers values from this to the token request.

type Parser

type Parser struct {
	ClientAuthenticator client.Authenticator
}

Parser parses the incoming http request to an OAuth token request. It also authenticates the request.

func (*Parser) Parse

func (s *Parser) Parse(ctx context.Context, rw http.ResponseWriter, r *http.Request) (*Request, error)

type Request

type Request struct {
	Id           string
	Client       *client.Client
	GrantType    oidc.GrantType
	RedirectUri  oidc.RedirectUri
	Scopes       map[oidc.Scope]struct{}
	Code         string
	CodeVerifier string
	RefreshToken string
}

Request is the request on token endpoint

func (*Request) Validate

func (r *Request) Validate(rules ...Rule) error

Validate validates the request against a set of rules and return the first violation.

type Response

type Response struct {
	AccessToken       string
	AccessTokenType   string
	AccessTokenExpiry time.Time
	RefreshToken      string
	IdToken           string
}

Response is all possible parameters returnable to token endpoint client.

func (*Response) MarshalJSON

func (r *Response) MarshalJSON() ([]byte, error)

type Rule

type Rule func(tr *Request) error

Rule enforces a certain aspect of the request.

type RuleSet

type RuleSet struct{}

func (RuleSet) Basic

func (_ RuleSet) Basic(provider *pkg.Provider) Rule

Jump to

Keyboard shortcuts

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