authenticationinfo

package
v0.0.0-...-ee57881 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(StoreRedis), "*"),
	wire.Struct(new(UIService), "*"),
)
View Source
var ErrNotFound = errors.New("authentication info entry not found")

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID             string `json:"id,omitempty"`
	T              T      `json:"t,omitempty"`
	OAuthSessionID string `json:"oauth_session_id,omitempty"`
	SAMLSessionID  string `json:"saml_session_id,omitempty"`
}

func NewEntry

func NewEntry(t T, oauthSessionID string, samlSessionID string) *Entry

type StoreRedis

type StoreRedis struct {
	Redis *appredis.Handle
	AppID config.AppID
}

func (*StoreRedis) Delete

func (s *StoreRedis) Delete(ctx context.Context, entryID string) (err error)

func (*StoreRedis) Get

func (s *StoreRedis) Get(ctx context.Context, entryID string) (entry *Entry, err error)

func (*StoreRedis) Save

func (s *StoreRedis) Save(ctx context.Context, entry *Entry) (err error)

type T

type T struct {
	UserID string `json:"user_id,omitempty"`
	// AMR is authentication means used in the authentication.
	// On Android, we cannot tell the exact biometric means used in the authentication.
	// Therefore, we cannot reliably populate AMR.
	//
	// From RFC8176, the AMR values "swk" and "user" may apply.
	// See https://developer.android.com/reference/androidx/biometric/BiometricPrompt#AUTHENTICATION_RESULT_TYPE_BIOMETRIC
	AMR             []string  `json:"amr,omitempty"`
	AuthenticatedAt time.Time `json:"authenticated_at,omitempty"`
	// ShouldFireAuthenticatedEventWhenIssueOfflineGrant indicates we should fire authenticated event during code exchange
	// This value will be filled in during interaction / workflow / authentication flow
	ShouldFireAuthenticatedEventWhenIssueOfflineGrant bool `json:"should_fire_authenticated_event_when_issue_offline_grant,omitempty"`

	// AuthenticatedBySessionType and AuthenticatedBySessionID
	// means this authentication is done by an existing session.
	// If a new idp session is created during the authentication process,
	// the idp session id will also be stored in AuthenticatedBySessionID.
	AuthenticatedBySessionType string
	AuthenticatedBySessionID   string
}

type UIService

type UIService struct {
	EndpointsProvider UIServiceEndpointsProvider
}

func (*UIService) GetAuthenticationInfoID

func (r *UIService) GetAuthenticationInfoID(req *http.Request) (string, bool)

func (*UIService) SetAuthenticationInfoInQuery

func (r *UIService) SetAuthenticationInfoInQuery(redirectURI string, e *Entry) string

type UIServiceEndpointsProvider

type UIServiceEndpointsProvider interface {
	ConsentEndpointURL() *url.URL
	SAMLLoginFinishURL() *url.URL
}

Jump to

Keyboard shortcuts

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