authrequest

package
v0.0.0-...-b9b5e9f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateStart                        = ""
	StateLoginRequested               = "login_requested"
	StateRefreshingIdentity           = "refreshing_identity"
	StatePromptingForIdentifier       = "prompting_for_identifier"
	StateValidatingIdentifier         = "validating_identifier"
	StateFindingAuthMethod            = "finding_auth_method"
	StatePromptingForPassword         = "prompting_for_password"
	StateValidatingPassword           = "validating_password"
	StatePasswordLoginSucceeded       = "password_login_succeeded"
	StatePromptingForIdentityProvider = "prompting_for_identity_provider"
	StateAwaitingIdpCallback          = "awaiting_idp_callback"
	StatePerformingAuthCodeExchange   = "performing_auth_code_exchange"
	StateAuthCodeExchangeSucceeded    = "auth_code_exchange_succeeded"
	StateAwaitingConsentChallenge     = "awaiting_consent_challenge"
	StateReceivedConsentChallenge     = "received_consent_challenge"
	StatePresentingConsent            = "presenting_consent"
	StateConsentRequestApproved       = "consent_request_approved"
	StateConsentRequestDeclined       = "consent_request_declined"
	StateAccepted                     = "accepted"
	StateDeclined                     = "declined"
	StateFailed                       = "failed"

	EventRequestLogin             = "request_login"
	EventSkipLoginRequest         = "skip_login_request"
	EventPerformLogin             = "perform_login"
	EventProvideIdentifier        = "provide_identifier"
	EventProvideInvalidIdentifier = "provide_invalid_identifier"
	EventProvideValidIdentifier   = "provide_valid_identifier"
	EventUsePasswordLogin         = "use_password_login"
	EventProvideValidPassword     = "provide_valid_password"
	EventProvideInvalidPassword   = "provide_invalid_password"
	EventProvidePassword          = "provide_password"
	EventUseOidcLogin             = "use_oidc_login"
	EventUseIdentityProvider      = "use_identity_provider"
	EventCallOidcCallback         = "call_oidc_callback"
	EventFailCodeExchange         = "fail_auth_code_exchange"
	EventSucceedCodeExchange      = "succeed_auth_code_exchange"
	EventAcceptLoginRequest       = "accept_login_request"
	EventReceiveConsentChallenge  = "receive_consent_challenge"
	EventSkipConsentChallenge     = "skip_consent_challenge"
	EventPresentConsentChallenge  = "present_consent_challenge"
	EventApproveConsentChallenge  = "approve_consent_challenge"
	EventDeclineConsentChallenge  = "decline_consent_challenge"
	EventSetRefreshedIdentity     = "set_refreshed_identity"
	EventFail                     = "fail"
	EventAccept                   = "accept"
	EventDecline                  = "decline"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	Identifier         string
	IdentifierError    error
	EmailDomain        string
	LoginChallenge     string
	StateVariable      string
	IdentityProviderId string
	IDToken            string
	AccessToken        string
	RefreshToken       string
	TokenExpiry        time.Time
	TokenType          string
	Claims             *Claims
	Identity           *loginstore.Identity
	ConsentChallenge   string
	PostConsentURL     string
	Error              error
	Subject            string
	// contains filtered or unexported fields
}

func CreateOrRestore

func CreateOrRestore(session *sessions.Session, callbacks fsm.Callbacks) *AuthRequest

func NewAuthRequest

func NewAuthRequest(callbacks fsm.Callbacks) *AuthRequest

func (*AuthRequest) Event

func (a *AuthRequest) Event(evt string) error

func (*AuthRequest) Save

func (a *AuthRequest) Save(w http.ResponseWriter, req *http.Request, session *sessions.Session) error

func (*AuthRequest) State

func (a *AuthRequest) State() string

func (*AuthRequest) ToDotGraph

func (a *AuthRequest) ToDotGraph() string

type Claims

type Claims struct {
	Subject       string `json:"sub"`
	DisplayName   string `json:"display_name"`
	FullName      string `json:"name"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
}

type RequestLoginProps

type RequestLoginProps struct {
	LoginChallenge string
	ClientID       string
	Scope          string
	Subject        *string
}

type StoredAuthRequest

type StoredAuthRequest struct {
	CurrentState       string
	Identifier         string
	IdentifierError    error
	EmailDomain        string
	LoginChallenge     string
	StateVariable      string
	IdentityProviderId string
	IDToken            string
	AccessToken        string
	RefreshToken       string
	Claims             *Claims
	Identity           *StoredIdentity
	ConsentChallenge   string
	PostConsentURL     string
	TokenExpiry        time.Time
	TokenType          string
	Subject            string
}

type StoredCredential

type StoredCredential struct {
	ID                  string
	CreatedAt           time.Time
	UpdatedAt           time.Time
	IdentityID          string
	Kind                string
	HashedPassword      *string
	Issuer              *string
	Identifiers         []StoredCredentialIdentifier
	InitialAccessToken  *string
	InitialRefreshToken *string
	InitialIdToken      *string
}

type StoredCredentialIdentifier

type StoredCredentialIdentifier struct {
	ID           string
	CredentialID string
	Identifier   string
}

type StoredIdentity

type StoredIdentity struct {
	ID          string
	State       string
	Credentials []StoredCredential
}

Jump to

Keyboard shortcuts

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