jumpcloud

package
v2.34.20 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdentifierTotpMfa          = "totp"
	IdentifierDuoMfa           = "duo"
	IdentifierU2F              = "webauthn"
	IdentifierJumpCloudProtect = "push"
)
View Source
const (
	MaxOpenRetries = 10
	RetryDelayMS   = 200 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	Context    string
	RedirectTo string
	Email      string
	Password   string
	OTP        string
}

AuthRequest is to be sent to JumpCloud as the auth req body

type Client

type Client struct {
	provider.ValidateBase
	// contains filtered or unexported fields
}

Client is a wrapper representing a JumpCloud SAML client

func New

func New(idpAccount *cfg.IDPAccount) (*Client, error)

New creates a new JumpCloud client

func (*Client) Authenticate

func (jc *Client) Authenticate(loginDetails *creds.LoginDetails) (string, error)

Authenticate logs into JumpCloud and returns a SAML response

type DeviceFinder

type DeviceFinder interface {
	// contains filtered or unexported methods
}

DeviceFinder is used to mock out finding devices

type FidoClient

type FidoClient struct {
	Device u2fhost.Device
	// contains filtered or unexported fields
}

FidoClient represents a challenge and the device used to respond

func NewFidoClient

func NewFidoClient(challenge, rpId, keyHandle, token string, deviceFinder DeviceFinder) (FidoClient, error)

NewFidoClient returns a new initialized FIDO1-based WebAuthnClient, representing a single device

func (*FidoClient) ChallengeU2F

func (d *FidoClient) ChallengeU2F() (*JumpCloudResponse, error)

ChallengeU2F takes a FidoClient and returns a signed assertion to send to Okta

type JCMessage

type JCMessage struct {
	Message string `json:"message"`
}

type JCRedirect

type JCRedirect struct {
	Address string `json:"redirectTo"`
}

JCRedirect is for unmarshalling the redirect address from the response after the auth

type JumpCloudPushResponse

type JumpCloudPushResponse struct {
	ID          string    `json:"id"`
	ExpiresAt   time.Time `json:"expiresAt"`
	InitiatedAt time.Time `json:"initiatedAt"`
	Status      string    `json:"status"`
	UserId      string    `json:"userId"`
}

type JumpCloudResponse

type JumpCloudResponse struct {
	PublicKeyCredential PublicKey `json:"publicKeyCredential"`
	Token               string    `json:"token"`
}

type PublicKey

type PublicKey struct {
	Id       string            `json:"id"`
	RawId    string            `json:"rawId"`
	Type     string            `json:"type"`
	Response PublicKeyResponse `json:"response"`
}

type PublicKeyResponse

type PublicKeyResponse struct {
	ClientData        string  `json:"clientDataJSON"`
	AuthenticatorData string  `json:"authenticatorData"`
	SignatureData     string  `json:"signature"`
	UserHandle        *string `json:"userHandle"`
}

type U2FDevice

type U2FDevice interface {
	u2fhost.Device
}

U2FDevice is used to support mocking this device with mockery https://github.com/vektra/mockery/issues/210#issuecomment-485026348

type U2FDeviceFinder

type U2FDeviceFinder struct{}

U2FDeviceFinder returns a U2F device

type XSRF

type XSRF struct {
	Token string `json:"xsrf"`
}

XSRF is for unmarshalling the xsrf token in the response

Jump to

Keyboard shortcuts

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