Skip to content

Securonix.CLI.Auth

Brian edited this page Jan 28, 2023 · 2 revisions

Confirm-SecuronixApiToken

Checks the validity of an API token with the Securonix Web API endpoint.

Syntax

Confirm-SecuronixApiToken
    [-Url] <string>
    [-Token] <string>

Connection was set by Connect-SecuronixApi

Confirm-SecuronixApiToken

Description

Confirm-SecuronixApiToken makes an API call to the AUTH/Validate Securonix Web API with the supplied token. If the token is valid, the API will respond with "Valid".

Example

Example 1: Validate a token

Request

Confirm-SecuronixApiToken -Url 'DunderMifflin.securonix.com/Snypr' -Token '12345678-90AB-CDEF-1234-567890ABCDEF'

Response

Valid

Example 2: Validate an invalid token

Confirm-SecuronixApiToken -Url 'DunderMifflin.securonix.com/Snypr' -Token '530bf219-5360-41d3-81d1-8b4d6f75956d'

Response

Invalid

Example 3: Connect to the Securonix Api and validate the connection.

Connect-SecuronixApi -Instance 'dundermifflin' `
    -Username 'MichaelBolton' -Password 'PiEcEsOfFlAiR'

Confirm-SecuronixApiToken

Responses

Connected
Valid

Parameters

-Url

Url endpoint for your Securonix instance. It must be in the following format:

https://<hostname or IPaddress>/Snypr

-Token

Valid authentication token.

Links

Securonix 6.4 REST API Categories - Auth


Connect-SecuronixApi

Request a new API token from the Securonix Web API endpoint.

Syntax

Connect-SecuronixApi
    [-Url] <string>
    [-Username] <string>
    [-Password] <string>
    [[-Validity] <int>]
Connect-SecuronixApi
    [-Instance] <string>
    [-Username] <string>
    [-Password] <string>
    [[-Validity] <int>]

Description

Connect-SecuronixApi makes an API call to the AUTH/Generate Securonix Web API with the supplied credentials. If the user successfully authenticates, a token is provided and environment variables are set for later use.

Example

Example 1: Request an API token

Request

Connect-SecuronixApi -Instance 'dundermifflin' `
    -Username 'MichaelBolton' -Password 'PiEcEsOfFlAiR'

Response

Connected

Parameters

-Url

Url endpoint for your Securonix instance. It must be in the following format:

https://<hostname or IPaddress>/Snypr

-Instance

Subdomain for your Securonix instance.

-Username

Username for the account.

-Password

Password for the account.

-Validity

The number of days the token will be valid.

If unspecified, the default length is 365 days.

Links

Securonix 6.4 REST API Categories - Auth


New-SecuronixApiToken

Request a new API token from the Securonix Web API endpoint.

Syntax

New-SecuronixApiToken
    [-Url] <string>
    [-Username] <string>
    [-Password] <string>
    [[-Validity] <int>]

Description

New-SecuronixApiToken makes an API call to the AUTH/Generate Securonix Web API with the supplied credentials. If the user successfully authenticates, a token is provided.

Example

Example 1: Request an API token

Request

New-SecuronixApiToken -Url 'DunderMifflin.securonix.com/Snypr' -Username 'JimHalpert' -Password 'sEcUrEpAsSwOrD'

Response

530bf219-5360-41d3-81d1-8b4d6f75956d

Example 2: Request an API token with access for 31 Days

New-SecuronixApiToken -Url 'Initech.securonix.com/Snypr' -Username 'MichaelBolton' -Password 'PiEcEsOfFlAiR' -Validity 31

Response

12345678-90AB-CDEF-1234-567890ABCDEF

Parameters

-Url

Url endpoint for your Securonix instance. It must be in the following format:

https://<hostname or IPaddress>/Snypr

-Username

Username for the account.

-Password

Password for the account.

-Validity

The number of days the token will be valid.

If unspecified, the default length is 365 days.

Links

Securonix 6.4 REST API Categories - Auth


Update-SecuronixApiToken

Renews existing authentication token.

Syntax

Update-SecuronixApiToken
    [-Url] <string>
    [-Token] <string>

Connection was set by Connect-SecuronixApi

Update-SecuronixApiToken

Description

Update-SecuronixApiToken makes an API call to the AUTH/Renew Securonix Web API to renew the supplied token. If the token was renewed, the API will respond with "Success".

Example

Example 1: Update a token

Request

Update-SecuronixApiToken -Url 'DunderMifflin.securonix.com/Snypr' -Token '12345678-90AB-CDEF-1234-567890ABCDEF'

Response

Success

Example 2: Validate an invalid token

Update-SecuronixApiToken -Url 'DunderMifflin.securonix.com/Snypr' -Token '530bf219-5360-41d3-81d1-8b4d6f75956d'

Response

Failure

Example 3: Connect to the Securonix Api and update the connection length.

Connect-SecuronixApi -Instance 'dundermifflin' `
    -Username 'MichaelBolton' -Password 'PiEcEsOfFlAiR'

Update-SecuronixApiToken

Responses

Connected
Success

Parameters

-Url

Url endpoint for your Securonix instance. It must be in the following format:

https://<hostname or IPaddress>/Snypr

-Token

Valid authentication token.

Links

Securonix 6.4 REST API Categories - Auth

Clone this wiki locally