yubico

package
v0.0.0-...-a860154 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOK                  = "OK"
	StatusBadOTP              = "BAD_OTP"
	StatusReplayedOTP         = "REPLAYED_OTP"
	StatusBadSignature        = "BAD_SIGNATURE"
	StatusMissingParam        = "MISSING_PARAMETER"
	StatusNoSuchClient        = "NO_SUCH_CLIENT"
	StatusOperationNotAllowed = "OPERATION_NOT_ALLOWED"
	StatusBackendError        = "BACKEND_ERROR"
	StatusNotEnoughAnswers    = "NOT_ENOUGH_ANSWERS"
	StatusReplayedRequest     = "REPLAYED_REQUEST"
)

Variables

View Source
var (
	ErrOTPHasInvalidLength = errors.New("otp has invalid length")
	ErrWrongOTPFormat      = errors.New("wrong otp format")
	ErrConvertModhexToHex  = errors.New("failed to convert modhex to hex")
)

Functions

func ValidateOTP

func ValidateOTP(otp string) (int64, error)

Types

type VerifyResponse

type VerifyResponse struct {
	Serial         int64
	Timestamp      int64
	SessionCounter int64
	SessionUse     int64
	Status         string
}

type YubiAuth

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

func NewYubiAuth

func NewYubiAuth(clientID int, clientSecret string) (*YubiAuth, error)

func (*YubiAuth) Verify

func (y *YubiAuth) Verify(otp string) (*VerifyResponse, error)

Jump to

Keyboard shortcuts

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