authorization

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMissingClientId = iota
	ErrMissingRedirectURI
	ErrInvalidRedirectURI
	ErrServerError
)
View Source
const (
	ResponseModeQuery    = "query"
	ResponseModeFragment = "fragment"
	ResponseModeFormPost = "form_post"
)
View Source
const (
	DisplayTypePopup = "popup"
	DisplayTypeTouch = "touch"
	DisplayTypeWAP   = "wap"
	DisplayTypePage  = "page"
)
View Source
const (
	DefaultMaxMaxAge             = 86400
	DefaultMinMaxAge             = 60
	DefaultMaxNonceLength        = 255
	DefaultMaxCodeVerifierLength = 255
	DefaultConsentOmissionPeriod = 86400
	DefaultAuthSessionExpiresIn  = 60
	DefaultIdTokenExpiresIn      = 86400
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLResponseHandler

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

func NewHTMLResponseHandler

func NewHTMLResponseHandler(w http.ResponseWriter, r *http.Request) *HTMLResponseHandler

func (*HTMLResponseHandler) Error

func (h *HTMLResponseHandler) Error(uri, typ, desc, state string)

func (*HTMLResponseHandler) Success

func (h *HTMLResponseHandler) Success(uri string, params map[string]string)

type Policy

type Policy struct {
	MaxMaxAge                                int
	MinMaxAge                                int
	AllowEmptyScope                          bool
	MaxNonceLength                           int
	MaxCodeVerifierLength                    int
	ConsentOmissionPeriod                    int
	AuthSessionExpiresIn                     int
	IdTokenExpiresIn                         int
	DefaultAuthorizationCodeFlowResponseMode string
	DefaultImplicitFlowResponseMode          string
	IgnoreInvalidResponseMode                bool
	RequireResponseModeSecurityLevelCheck    bool
}

func DefaultPolicy

func DefaultPolicy() *Policy

type RedirectResponseHandler

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

func (*RedirectResponseHandler) Error

func (h *RedirectResponseHandler) Error(uri, typ, desc, state string)

func (*RedirectResponseHandler) Success

func (h *RedirectResponseHandler) Success(uri string, params map[string]string)

type Request

type Request struct {
	Flow         *flow.Flow `json:"flow"`
	ClientId     string     `json:"client_id"`
	Scope        string     `json:"scope"`
	RedirectURI  string     `json:"redirect_uri"`
	ResponseMode string     `json:"response_mode"`
	State        string     `json:"state"`
	CodeVerifier string     `json:"code_verifier"`
	Nonce        string     `json:"nonce"`
	Display      string     `json:"display"`
	Prompt       string     `json:"prompt"`
	MaxAge       int64      `json:"max_age"`
	UILocale     string     `json:"ui_locale"`
	IdTokenHint  string     `json:"id_token_hint"`
	LoginHint    string     `json:"login_hint"`
}

func DecodeRequest

func DecodeRequest(encoded string) *Request

func (*Request) Encode

func (r *Request) Encode() string

func (*Request) ToSession

func (r *Request) ToSession(code string, expiresIn, authTime int64) *Session

type ResponseHandler

type ResponseHandler interface {
	Success(uri string, params map[string]string)
	Error(uri, typ, desc, state string)
}

func ResponseHandlerForMode

func ResponseHandlerForMode(mode string, w http.ResponseWriter, r *http.Request) ResponseHandler

type ResponseParamType

type ResponseParamType int
const (
	ParamTypeQuery ResponseParamType = iota
	ParamTypeFragment
)

func (ResponseParamType) Connector

func (t ResponseParamType) Connector(uri string) string

type Session

type Session struct {
	RedirectURI  string
	Code         string
	ExpiresIn    int64
	CodeVerifier string
	Nonce        string
	AuthTime     int64
}

Jump to

Keyboard shortcuts

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