identity

package
v1.7.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MechanismUsernamePassword is the string which identifies the username/password mechanism for completing
	// a login attempt
	MechanismUsernamePassword = "UP"

	// ActionAnswer is the string which is sent to an AdvanceAuthentication request to indicate we're providing
	// the credentials in band in text format (i.e., we're sending a password)
	ActionAnswer = "Answer"

	// SummaryLoginSuccess is returned by a StartAuthentication to indicate that login does not need
	// to proceed to the AdvanceAuthentication step.
	// We don't handle this because we don't expect it to happen.
	SummaryLoginSuccess = "LoginSuccess"

	// SummaryNewPackage is returned by a StartAuthentication call when the user must complete a challenge
	// to complete the log in. This is expected on a first login.
	SummaryNewPackage = "NewPackage"
)

Variables

This section is empty.

Functions

func MockIdentityServer

func MockIdentityServer(t testing.TB) (string, *http.Client)

MockIdentityServer returns a URL of a mocked CyberArk identity server and an HTTP client with the CA certs needed to connect to it..

Types

type Client

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

Client is an client for interacting with the CyberArk Identity API and performing a login using a username and password. For context on the behaviour of this client, see the Python SDK: https://github.com/cyberark/ark-sdk-python/blob/3be12c3f2d3a2d0407025028943e584b6edc5996/ark_sdk_python/auth/identity/ark_identity.py

func New

func New(httpClient *http.Client, baseURL string, subdomain string) *Client

New returns an initialized CyberArk Identity client using a default service discovery client.

func (*Client) AuthenticateRequest

func (c *Client) AuthenticateRequest(req *http.Request) error

func (*Client) LoginUsernamePassword

func (c *Client) LoginUsernamePassword(ctx context.Context, username string, password []byte) error

LoginUsernamePassword performs a blocking call to fetch an auth token from CyberArk Identity using the given username and password. The password is zeroed after use. Tokens are cached internally and are not directly accessible to code; use Client.AuthenticateRequest to add credentials to an *http.Request.

Directories

Path Synopsis
cmd
testidentity command

Jump to

Keyboard shortcuts

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