totp

package
v0.8.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const InternalContextKeyURL = "url"

Variables

This section is empty.

Functions

func KeyToHTMLImage

func KeyToHTMLImage(key *otp.Key) (string, error)

func NewKey

func NewKey(ctx context.Context, accountName string, d interface {
	config.Provider
}) (*otp.Key, error)

func NewTOTPImageQRNode

func NewTOTPImageQRNode(key *otp.Key) (*node.Node, error)

func NewTOTPSourceURLNode

func NewTOTPSourceURLNode(key *otp.Key) *node.Node

func NewUnlinkTOTPNode

func NewUnlinkTOTPNode() *node.Node

func NewVerifyTOTPNode

func NewVerifyTOTPNode() *node.Node

Types

type CredentialsConfig

type CredentialsConfig struct {
	// TOTPURL is the TOTP URL
	//
	// For more details see: https://github.com/google/google-authenticator/wiki/Key-Uri-Format
	TOTPURL string `json:"totp_url"`
}

CredentialsConfig is the struct that is being used as part of the identity credentials.

type SchemaExtension

type SchemaExtension struct {
	AccountName string
	// contains filtered or unexported fields
}

func NewSchemaExtension

func NewSchemaExtension(fallback string) *SchemaExtension

func (*SchemaExtension) Finish

func (r *SchemaExtension) Finish() error

func (*SchemaExtension) Run

func (r *SchemaExtension) Run(_ jsonschema.ValidationContext, s schema.ExtensionConfig, value interface{}) error

type Strategy

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

func NewStrategy

func NewStrategy(d registrationStrategyDependencies) *Strategy

func (*Strategy) CountActiveCredentials

func (s *Strategy) CountActiveCredentials(cc map[identity.CredentialsType]identity.Credentials) (count int, err error)

func (*Strategy) ID

func (*Strategy) Login

func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow, ss *session.Session) (i *identity.Identity, err error)

func (*Strategy) NodeGroup

func (s *Strategy) NodeGroup() node.Group

func (*Strategy) PopulateLoginMethod

func (s *Strategy) PopulateLoginMethod(r *http.Request, requestedAAL identity.AuthenticatorAssuranceLevel, sr *login.Flow) error

func (*Strategy) PopulateSettingsMethod

func (s *Strategy) PopulateSettingsMethod(r *http.Request, id *identity.Identity, f *settings.Flow) error

func (*Strategy) RegisterLoginRoutes

func (s *Strategy) RegisterLoginRoutes(r *x.RouterPublic)

func (*Strategy) RegisterSettingsRoutes

func (s *Strategy) RegisterSettingsRoutes(_ *x.RouterPublic)

func (*Strategy) Settings

func (*Strategy) SettingsStrategyID

func (s *Strategy) SettingsStrategyID() string

Jump to

Keyboard shortcuts

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